Skip to main content
Share Your Experience: Take the 2024 Developer Survey
31 votes

Changing permalinks gives me 404 errors on nginx

I'm using wordpress multisite with custom permalink setting: /%category%/%postname%/ /etc/nginx/site-available/domain.conf On server{ location / { try_files $uri $uri/ /index.php?q=$uri$args; } ...
Domi's user avatar
  • 411
11 votes

Changing permalinks gives me 404 errors on nginx

Had to add this piece of code to both the /sites-available/your-settings-file and /sites-enabled/your-settings-file: server { [...] if (!-e $request_filename) { rewrite ^.*$ /index.php last; } [...
Angelo Reale's user avatar
9 votes
Accepted

Wordpress monthly upload directory owner set to root

I've had the same problem, and in my case it was the Wordpress cronjob. I was calling the wp-cron.php as a root cron job, and this script also generates the monthly upload folder. If you call wp-cron....
Marco's user avatar
  • 106
7 votes

WordPress Update - This is usually due to inconsistent file permissions.: wp-admin/includes/update-core.php

I solved this by making the webserver user the owner and the group of all the files in the WordPress directory. I figured out the webserver user was daemon with: ps aux | egrep '(apache|httpd)' Then ...
Mike P. Sinn's user avatar
5 votes

security+best practices: root or www-data on a wordpress content folder?

I fixed this by running this command: cd /var/www/html/ sudo chown -Rv www-data:www-data * Changed ownership back to www-data instead of root. This article helped me: http://johnqunknown.me/...
dr202's user avatar
  • 51
5 votes

What's the proper way to setup WP-CLI on Ubuntu so that I don't have to use the flag --allow-root?

All files and folders should be owned by www-data user and group if not then WordPress can't change files hence fails to update from dashboard. wp-cli says to use sudo -u www-data -i -- wp <command&...
Sangam's user avatar
  • 151
5 votes
Accepted

Which Apache-modules must I enable?

Here is the list of minimum Apache modules which is required to run WordPress websites. mod_alias mod_authz_host mod_deflate mod_dir mod_expires mod_headers mod_mime mod_rewrite mod_log_config ...
Nefro's user avatar
  • 648
4 votes
Accepted

Shortest way to install WP-CLI

Downloading the Phar file is the recommended installation method for most users. As you showed, it's basically just one line. It can't really get shorter than that. And the steps make sense: download ...
swissspidy's user avatar
  • 3,844
2 votes

How does one suppress a 404 status code in a WordPress page?

Take a look at the pre_handle_404 hook (added in v4.5.0): https://developer.wordpress.org/reference/hooks/pre_handle_404/ // add to your functions.php add_filter('pre_handle_404', function($preempt, $...
Jonathan MacDonald's user avatar
2 votes

Sharing one WordPress installation between several "sites"?

WordPress multisite installation with database: cd /var/www sudo mkdir -p domainone.com/public_html && sudo mkdir -p domaintwo.com/public_html && sudo chown -R vancoder:www-data /var/...
Daniel's user avatar
  • 351
2 votes
Accepted

Sharing one WordPress installation between several "sites"?

Am I missing a requirement, or will multisite suffice? http://codex.wordpress.org/Create_A_Network Multiple blogs, one install, one database...
vancoder's user avatar
  • 7,845
2 votes

What's the proper way to setup WP-CLI on Ubuntu so that I don't have to use the flag --allow-root?

first of all you need to fix so you're allowed to login as www-data if that's what you want to do. Otherwise you can do this as root. If you're logged in as root, add to your shell (i.e. /root/....
Kentur's user avatar
  • 29
2 votes

enable SFTP via SSH keys in wordpress

For connection through ssh, you have to specify the ssh user using FTP_USER define( 'FS_METHOD', 'ssh' ); define( 'FTP_BASE', '/home/user/wordpress' ); define( 'FTP_PUBKEY', '/home/user/.ssh/id_rsa....
Tunji's user avatar
  • 2,931
2 votes
Accepted

Right permissions to WordPress directory

Standard file/folder permission for WordPress: 755 for folders 644 for files
Abdul Awal Uzzal's user avatar
2 votes
Accepted

Flatten media files in uploads directory via linux terminal eliminating thumbnails?

Warning: Please make a backup first, as this can do irreversable damage. Go to your uploads directory: cd /path/to/directory cp -r uploads uploads.backup Flatten the files in uploads directory: ...
cenk's user avatar
  • 331
2 votes
Accepted

Is Postfix required for WordPress contact forms in general?

You don't need Postfix if you use an SMTP plugin like, for example, WP Mail SMTP. Such kind of plugins can send email from your Google account via SMTP. I have just checked it by stopping postfix and ...
KAGG Design's user avatar
  • 1,842
2 votes
Accepted

A shorter way to automatically update WordPress?

If you have this statement (by default) in your wp-config file define( 'WP_AUTO_UPDATE_CORE', true ); Then WP core files are automatically updated for you. This assumes that you have traffic to your ...
Rick Hellewell's user avatar
2 votes

Call to undefined function mysql_connect() After upgrading PHP 7.1 to 7.3

I mean your php.ini is changed, check for the entry extension=php_mysqll.dll. (If you has no knowledge where is your used php.ini - see https://stackoverflow.com/questions/8684609/dude-wheres-my-php-...
bueltge's user avatar
  • 17.1k
2 votes

Carriage Return control character (^M) found in wp-config-sample.php

Unix and Unix-like operating systems (like Linux) use different line endings in their text files. The format of Windows and Unix text files differs slightly. In Windows, lines end with both the line ...
Pat J's user avatar
  • 11.9k
2 votes

WordPress sites being filled with random PHP files

First steps: Take the server offline, if you can access it directly. - The chance of your server being part of a larger scheme at this point is pretty high. If you can't take it offline, check your ...
syseng21's user avatar
1 vote
Accepted

Can't upload media to my Raspberry Pi Wordpress server

you need to change the owner of the wordpress folder to www-data. For example, if you put your wordpress folder in /var/www/my_new_wordpress_site, you will need to run the following command: sudo ...
Clivant Yeo's user avatar
1 vote

login wp impossible

You probably have a problem-causing plugin. Look at the error.log file which will tell you the file that is causing the problem. Rename that plugin's folder (use your hosting control panel's File ...
Rick Hellewell's user avatar
1 vote

Communcation with wordrpess and linux server

Its just PHP dude, if you want to do this, just google it. But, why do you want to do this? Can you be more specific? Because, PHP can retrieve this data, but depending on what you want to do, you'll ...
Pedro Filho's user avatar
1 vote
Accepted

WP-CLI sudden empty response

I've run into the same problem. It worked on Saturday. This Monday it auto-upgraded to 7.0.10, now it breaks. I don't have a fix, so here's more information that MAY help debugging? I'm on CentOS7 ...
Ipstenu's user avatar
  • 539
1 vote
Accepted

WordPress incorrectly redirects to local IP address?

Change the Site URL in Options Table. UPDATE `wp_options` SET `option_value` = 'YOUR_SITE_URL' WHERE `option_name` = 'siteurl' OR `option_name` = 'home'; Also change the static URLs in your post ...
JItendra Rana's user avatar
1 vote
Accepted

Apache /Ubuntu server not running WordPress installation, outputting PHP code like HTML

Simple mistake. Needed to make sure I installed the correct php module for apache, which is libapache2-mod-php7.0. I had installed one for a previous version of php.
heliotrope's user avatar
1 vote

enable SFTP via SSH keys in wordpress

I asked this question when i am newbie. But finally realized no need to setup ssh and sftp even ftp account for wordpres when you are using in vps or cloud. I have used sftp client to file transfer. ...
theonlineking.com's user avatar
1 vote
Accepted

SELinux security vs Wordpress updates

No. First there is the practical problem of enabling your OS being influenced by the web server, something that should never be possible. (a plugin will trigger an update and make you open to all ...
Mark Kaplun's user avatar
  • 23.4k
1 vote

How can I add a row in a table from a Linux Shell?

I'd assume you can use WP-CLI for that. Especially wp db import should be usable for that. Last but not least the MySQL Command-Line Tool itself, which I'd think is used by WP-CLI for the tasks, can ...
Nicolai Grossherr's user avatar
1 vote

Definitive wordpress directory ownership and permissions on linux

If your aim is security, the only directory writable by the web server should be uploads. Yes, it means no easy updates, but in a secure environment the web server should not be able to write to ...
Mark Kaplun's user avatar
  • 23.4k

Only top scored, non community-wiki answers of a minimum length are eligible