DISALLOW_FILE_EDIT constant being ignored

In my wp-config.php file, I have the line: define('DISALLOW_FILE_EDIT', true); I always include this on all sites as standard, and it's always worked exactly as expected. However, I've only just noticed that on one client's site, it has stopped working. They have the User Role Editor plugin that was set up to define a handful of custom roles. Once the roles were set up, the plugin was deactivated (it doesn't need to be active for the roles to exist) and …
Category: Web

Database issue?

I installed WordPress from a zip file via FTP, followed the install procedure exactly - When accessing the URL, all I could see is a default page without opening any install script. I then manually entered https://"mysite".com/wp-login.php and it opened a login window. I entered the username and PW I created in wp-config.php - I was advised no such user- double checked everything and found no errors I could determine. I'm guessing that the problem is something in either database …
Category: Web

Wordpress multisite subdirectory redirect infinite loop issue

Any time I create a new site on my multisite install, I get an infinite loop redirect when navigating to that site's admin. I'm using the default htaccess supplied by WP for my subdirectory install. Here's what I have: RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) site/$2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ site/$2 [L] RewriteRule . index.php …
Category: Web

Generate Wordpress salt

I am in need of a function that automatically generates and returns salts for Wordpress wp-config.php (Don't link me to their API, I'm looking for offline solution). Does Wordpress core has this function defined somewhere? If it doesn't, can these salts be generated randomly or are there any specific rules for creating them? Edit: This is what I ended up with: $keys = array('AUTH_KEY', 'SECURE_AUTH_KEY', 'LOGGED_IN_KEY', 'NONCE_KEY', 'AUTH_SALT', 'SECURE_AUTH_SALT', 'LOGGED_IN_SALT', 'NONCE_SALT'); $salts = ''; foreach ($keys as $key) { $salt …
Category: Web

error:-Cannot modify header information - headers already sent by

whewn ever i try to login http://affiliatesurge.com.au/wp-admin/ i got "" Warning: Cannot modify header information - headers already sent by (output started at /home/affiliat/public_html/wp-config.php:1) in /home/affiliat/public_html/wp-includes/pluggable.php on line 881 "" Error ... i already try removing spacing in wp-config and functions.php
Category: Web

Could not override the url in wp-config file

for the wordpress deployment purpose I have added the following code in wp-config.php file define( 'WP_HOME', 'http://example.com'); define( 'WP_SITEURL', 'http://example.com'); I did not make any changes in wp-option table. there its shows localhost url. I don't want to change here every time. so I tried to override using wp-config file. issues is: it is not working on server. all the images are showing with localhost url
Category: Web

What's the point of forbidding access to wp-config.php?

Probably a dumb question... the hardening doc suggests setting up your web server so that it prevents access to wp-config.php. If you do this, and a client tries to access the file, Apache returns 403 Forbidden, as expected. If you don't do this, Apache returns 200 Ok with an empty file. This is also as expected, because none of the php code in this file produces any output. So what's the point? Surely this would only be an issue if …
Category: Web

Is there any point setting the keys and salts in wp-config.php?

I'm auto-generating WordPress (5.9.3) sites on a VPS. I could, as part of the generation script, create random strings for the various keys and salts in wp-config.php. However, there doesn't appear to be any unequivocal statement in the docs that this is actually necessary, and various sources appear to state that WP will generate the keys and salts anyway if there are none in wp-config.php. Two questions: If I choose to leave this up to WP, what should I actually …
Category: Web

ABSPATH not defined?

this issue needs a bit of backstory and I'm not sure on how to fix this. I had a server running Apache and PHP 5.4, I moved to a vps using NGINX and PHP 7.4. Right now I'm getting errors saying ABSPATH is not defined (the directory has changed). These are the errors: [04-Apr-2022 14:38:47 Europe/Berlin] PHP Warning: require(ABSPATHWPINC/option.php): failed to open stream: No such file or directory in /home/cloudpanel/htdocs/dev.pctoppers.nl/wp-includes/functions.php on line 8 [04-Apr-2022 14:38:47 Europe/Berlin] PHP Fatal error: require(): …
Category: Web

Fix 403 error on WordPress multisite network using subdomains

I've a WordPress installation that I've transformed into a multisite network. I'm using cPanel and I've followed all the instructions to configure the WordPress installation. I've set up the subdomains mode, so for every new website I need to create a subdomain using cPanel of my shared hosting provider. The problem is that I get a 403 error every time I try to access to a subdomain website. How I can fix this and is the .htaccess code correct? NB: …
Category: Web

Cloned site not connecting to database - MAMP

First off, I'm a WordPress noob, so I apologize if there is an easy solution. I'm trying to get a live website working on my local MAMP environment. I've successfully cloned the git repo into the htdocs directory in MAMP. I also also created a database within phpmyadmin called 'landing'. Once the database was created, I imported a fresh copy of the production site's database. After the database was set up, I renamed the wp-config-example.php file to wp-config.php and added …
Category: Web

Cannot change the definition of AUTOMATIC_UPDATER_DISABLED

I have several WordPress sites that I want to enable auto update. I installed Background Update Tester to verify that the updates were enabled correctly, but I get the following message: FAIL: The AUTOMATIC_UPDATER_DISABLED constant is defined as true. It was defined as true in wp-config.php, but after I removed the line, it's still saying that the constant is true. I also tried to define the constant as false to no avail. I also tried to add this filter inside …
Category: Web

Custom DB_COLLATE (collation) value not working on fresh install?

I always knew that WordPress uses utf8_general_ci as tables collation, but recently it keeps installing utf8mb4_unicode_520_ci. What I do is: Download WordPress from wordpress.org Rename wp-config-example.php to wp-config.php Set the defined constants as below /** Database Charset to use in creating database tables. */ define('DB_CHARSET', 'utf8'); /** The Database Collate type. Don't change this if in doubt. */ define('DB_COLLATE', 'utf8_general_ci'); Set database configuration properly and create an empty database with charset and collation as above. Open mysite.dev where the WordPress …
Category: Web

Wordpress with all of wp_content/ or uploads/ on external server?

I'm setting up an install of Wordpress on our server instances which are hosted with AWS. Of course, everything that's on our servers is in version control with git and there is no FTP so uploading anything like media or plugins directly to our servers is a no go. What I'd like to do is host the core Wordpress files on our servers but save uploads on an external server. Ideally, this would be all of wp_content/ but I'd settle …
Category: Web

What is the difference in the WP memory limits?

I have seen this question PHP Memory Limit vs. WP Memory Limit and it has a really poor answer and the question isn't that good either. I am on a dedicated server and can do whatever I want. I want to make sure our site runs as fast as possible and had define( 'WP_MAX_MEMORY_LIMIT', '1024M' ); in our config. But then our theme had an update and I saw a screen that showed our PHP memory was 1024MB and our …
Category: Web

Can't access Dashboard of a Multisite Wordpress. Chrome results in "ERR_TOO_MANY_REDIRECTS"

I'm suffering with this problem for two days. Here is my envroiment: I"m using Amazon EC2 with Ubuntu 16.04, I've installed LAMP, phpmyadmin, vsftpd and that's all. Then I've configured one clean Wordpress installation and everything is working fine with my main site. But, when I've setup a Multisite, whenever I try to access the Dashboard of any subsite beside the primary one, in Chrome, it results in "ERR_TOO_MANY_REDIRECTS". In other browsers, I got similar issues. Its not a browser …
Category: Web

How to stage a redesigned site on a new webhost while the original site is still live?

thanks in advance for any advice! My client has a live site currently hosted on GoDaddy. I am developing a redesigned site for him on Local. I don't like working on GoDaddy and have advised him to move the new site to a new webhost when it's time to take the new site live. I have set up a staging site on the new webhost so we can both easily make revisions to it. The new site is an entirely …
Category: Web

Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 20480 bytes)

I have made wordpress pages on divi builder on m localhost and they were working fine without any problem but when i installed divi on my online website its giving me the error Fatal error: Allowed memory size of 41943040 bytes exhausted (tried to allocate 20480 bytes) I tried changing the define( 'WP_MEMORY_LIMIT', '40M' ); in both my wp-config and default-constants.php file but its still giving the same error! This error appears when ever I open my homepage. I searched …
Category: Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.