$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>localhost - change wordpress upload url to subdomain on xampp local|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

localhost - change wordpress upload url to subdomain on xampp local

matteradmin10PV0评论

Firstly, I am sorry for bad English Language

I want to make a site using wp on local with xampp 3.2.2 (win10)

To avoid future problems (e.g changing domain after moving to live or changing media file path in db) i stablish a virtual host & a subdomain by putting this code in httpd-vhosts.conf

NameVirtualHost *:80
<VirtualHost *:80>
    ServerName xyz
    ServerAlias xyz
    ServerAdmin [email protected]
    DocumentRoot "C:/xampp/htdocs/xyz"
</VirtualHost>


<VirtualHost *:80>
    ServerName dl.xyz
    ServerAlias dl.xyz
    ServerAdmin [email protected]
    DocumentRoot "C:/XAMPP/htdocs/xyz/dl"
</VirtualHost>

& this code to httpd.conf

Alias /xyz "C:/XAMPP/htdocs/xyz/"
<Directory "C:/XAMPP/htdocs/xyz/">
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
  • then i check subdomain to making sure it's working by making simple index.html to "dl" DIR (dl.xyz) & work Properly.
  • then I install wp and after some configuration I follow this article step to change WordPress default upload path:

/

This is my database change:

upload_path:

C:/xampp/htdocs/xyz/dl/uploads

upload_url_path:


I change "dl" DIR permission As described here: In this way: dl Folder properties >> sharing Tab >> Advanced Sharing >> check share this folder >> Permissions >> select Everyone as username >> check Allow option for "full Control" "Change" "Read" this is 777 permissions

now when i want to upload file to media this error appeared:

Unable to create directory C:/xampp/htdocs/xyz/dl/uploads/2019/02. Is its parent directory writable by the server?

Firstly, I am sorry for bad English Language

I want to make a site using wp on local with xampp 3.2.2 (win10)

To avoid future problems (e.g changing domain after moving to live or changing media file path in db) i stablish a virtual host & a subdomain by putting this code in httpd-vhosts.conf

NameVirtualHost *:80
<VirtualHost *:80>
    ServerName xyz
    ServerAlias xyz
    ServerAdmin [email protected]
    DocumentRoot "C:/xampp/htdocs/xyz"
</VirtualHost>


<VirtualHost *:80>
    ServerName dl.xyz
    ServerAlias dl.xyz
    ServerAdmin [email protected]
    DocumentRoot "C:/XAMPP/htdocs/xyz/dl"
</VirtualHost>

& this code to httpd.conf

Alias /xyz "C:/XAMPP/htdocs/xyz/"
<Directory "C:/XAMPP/htdocs/xyz/">
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>
  • then i check subdomain to making sure it's working by making simple index.html to "dl" DIR (dl.xyz) & work Properly.
  • then I install wp and after some configuration I follow this article step to change WordPress default upload path:

https://www.webnots/move-wordpress-images-folder-to-subdomain/

This is my database change:

upload_path:

C:/xampp/htdocs/xyz/dl/uploads

upload_url_path:

http://dl.xyz/uploads

I change "dl" DIR permission As described here: https://www.youtube/watch?v=mX2WsUfW_x4 In this way: dl Folder properties >> sharing Tab >> Advanced Sharing >> check share this folder >> Permissions >> select Everyone as username >> check Allow option for "full Control" "Change" "Read" this is 777 permissions

now when i want to upload file to media this error appeared:

Unable to create directory C:/xampp/htdocs/xyz/dl/uploads/2019/02. Is its parent directory writable by the server?

Share Improve this question edited Feb 6, 2019 at 15:35 Payam Baharan asked Feb 6, 2019 at 8:11 Payam BaharanPayam Baharan 112 bronze badges 1
  • Please put your permissions procedures inside the question instead of linking to the video. – Max Yudin Commented Feb 6, 2019 at 8:27
Add a comment  | 

1 Answer 1

Reset to default 1

Problem was / in upload_path: That most change to\ C:/xampp/htdocs/xyz/dl/uploads C:\xampp\htdocs\xyz\dl\uploads

Post a comment

comment list (0)

  1. No comments so far