Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The method of modifying the permission setting of php File in wordpress

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Xiaobian to share with you how to modify the php file permissions in wordpress, I believe most people still do not know how to share this article for your reference, I hope you have a lot of harvest after reading this article, let's go to understand it together!

Wordpress permissions have a great impact on installation and use. If your server is using linux, you can use cd command to change the file or folder where you need to modify permissions, and then use chmod command to modify file permissions.

If you want to know more about WordPress, you can click: WordPress Tutorial

Here are a few solutions to problems caused by file permissions.

1. Cannot install theme or modify theme or delete theme

chmod 755 wordpressfind wordpress -type d -exec chmod 755 {} \;find wordpress -iname "*.php" -exec chmod 644 {} \;chown -R nginx:nginx wordpress

Second, when your WordPress encounters the following problems:

1. Cannot upload images

2. Cannot install themes, plugins automatically (FTP account required)

3. Cannot update automatically

4. Any other problem that requires wordpress to write files

These problems are basically a reason, your wordpress directory does not belong to the current user and group, that is, web access users do not have permission to operate wp all need to write permission to operate. Solution:

First you need to have root privileges, SSH login, enter the wp installation directory:

cd /var/www/html/my_wp_blog

Give all write permissions:

chmod 777 wp-content

Next upload an image to your blog post, WP will generate a directory, and then see which user created the folder. Under normal circumstances, this user name is called " apache", there are also many people found that this user is "nobody", on the floating easy itself encountered problems, I installed on the VPS is LNmp, this user is "www".

Enter the wp-content directory of wp and view the permissions of all files/folders under this directory, belonging users and user groups:

cd wp-contentls -ltotal 16 -rw-r-r- 1 root root 30 May 4 2007 index.php drwxr-xr-x 3 root root 4096 Feb 10 19:31 plugins drwxr-xr-x 5 root root 4096 Mar 23 03:04 themes drwxrwxrwx 3 www www 4096 Mar 24 02:08 uploads

Note that uploads are created by users www.

Next, restore wp-content permissions to 755::

cd .. chmod 755 wp-content

Next is the actual repair command, change the owner of the folder where wp is located to the user www:

cd .. chown -R www:www my_wp_blog The above is all the contents of the method of modifying the permissions of php files in wordpress. Thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report