I've been tasked to move a website into a new domain, and I've encontered this weird issue.
On the homepage, I always see these:
Notice: Constant AUTOSAVE_INTERVAL already defined in /home/gturnat/public_html/wp-config.php on line 99
Notice: Constant WP_POST_REVISIONS already defined in /home/gturnat/public_html/wp-config.php on line 100
What I have tried:
- Notice: Constant WP_POST_REVISIONS already defined suggests commenting the constants on
default-constants.php
, but it doesn't work. - Settings
display_errors
to0
,'0'
or'Off'
does nothing. - Running
error_reporting(0)
will still display the errors. - Creating a
mu-plugin
(As suggested on How can I stop PHP notices from appearing in wordpress?).
Nothing happens and the plugin isn't even loaded.
The errors still keep showing up. - Tried to comment out the lines in
wp-config.php
, but didn't work. The notices are still there. - Removed the lines entirelly and moved them around
wp-config.php
, but the warnings insist it is on line 99 and 100.
Causing a syntax error insidewp-config.php
does lead to an error being logged, which means that the file isn't cached. - Tried to enable and disable the debug mode, set
display_errors
tofalse
,0
,'0'
and'Off'
, but doesn't work. - Ran
grep -1R WP_POST_REVISIONS *
andgrep -1R AUTOSAVE_INTERVAL *
with the following result:root@webtest:# grep -lR WP_POST_REVISIONS *
wp-config.php
wp-includes/default-constants.php
wp-includes/revision.php
root@webtest:# grep -lR AUTOSAVE_INTERVAL *
wp-config.php
wp-includes/script-loader.php
wp-includes/default-constants.php
wp-includes/class-wp-customize-manager.php
I really am out of any other idea to try.
I'm using Wordpress 4.7.2, running on PHP 5.4 with the following modules loaded:
There is no op-cache working in the server. Just those options.
PHP was configured with the following options:
'./configure' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--prefix=/opt/alt/php54' '--exec-prefix=/opt/alt/php54' '--bindir=/opt/alt/php54/usr/bin' '--sbindir=/opt/alt/php54/usr/sbin' '--sysconfdir=/opt/alt/php54/etc' '--datadir=/opt/alt/php54/usr/share' '--includedir=/opt/alt/php54/usr/include' '--libdir=/opt/alt/php54/usr/lib64' '--libexecdir=/opt/alt/php54/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/opt/alt/php54/usr/share/man' '--infodir=/opt/alt/php54/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib64' '--with-config-file-path=/opt/alt/php54/etc' '--with-config-file-scan-dir=/opt/alt/php54/link/conf' '--with-exec-dir=/usr/bin' '--with-layout=GNU' '--disable-debug' '--disable-rpath' '--without-pear' '--without-gdbm' '--with-pic' '--with-zlib' '--with-bz2' '--with-gettext' '--with-gmp' '--with-iconv' '--with-openssl' '--with-kerberos' '--with-mhash' '--with-readline' '--with-pcre-regex=/opt/alt/pcre/usr' '--with-libxml-dir=/opt/alt/libxml2/usr' '--with-curl=/opt/alt/curlssl/usr' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-shmop' '--enable-calendar' '--enable-xml' '--enable-force-cgi-redirect' '--enable-fastcgi' '--enable-pcntl' '--enable-bcmath=shared' '--enable-dba=shared' '--with-db4=/usr' '--enable-dbx=shared,/usr' '--enable-dom=shared' '--enable-fileinfo=shared' '--enable-intl=shared' '--enable-json=shared' '--enable-mbstring=shared' '--enable-mbregex' '--enable-pdo=shared' '--enable-phar=shared' '--enable-posix=shared' '--enable-soap=shared' '--enable-sockets=shared' '--enable-sqlite3=shared,/opt/alt/sqlite/usr' '--enable-sysvsem=shared' '--enable-sysvshm=shared' '--enable-sysvmsg=shared' '--enable-wddx=shared' '--enable-xmlreader=shared' '--enable-xmlwriter=shared' '--enable-zip=shared' '--with-gd=shared' '--enable-gd-native-ttf' '--with-jpeg-dir=/usr' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--with-t1lib=/opt/alt/t1lib/usr' '--with-imap=shared' '--with-imap-ssl' '--with-xmlrpc=shared' '--with-ldap=shared' '--with-ldap-sasl' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--enable-ucd-snmp-hack' '--with-xsl=shared,/usr' '--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-pgsql=shared,/usr' '--with-pdo-sqlite=shared,/opt/alt/sqlite/usr' '--with-mssql=shared,/opt/alt/freetds/usr' '--with-interbase=shared,/usr' '--with-pdo-firebird=shared,/usr' '--with-pdo-dblib=shared,/opt/alt/freetds/usr' '--with-mcrypt=shared,/usr' '--with-tidy=shared,/usr' '--with-recode=shared,/usr' '--with-enchant=shared,/usr' '--with-pspell=shared' '--with-unixODBC=shared,/usr' '--with-icu-dir=/opt/alt/libicu/usr' '--with-sybase-ct=shared,/opt/alt/freetds/usr'
As a testing point, I tried to run it on PHP 5.6, with the same results, with the following modules:
find in files
in the entire directory forAUTOSAVE_INTERVAL
, obviously something else is defining it. Also, comment out an essential constant likeDB_NAME
, see if the site is still working. It's possible that you are modifying the wrongwp-config.php
file.find ./ | grep wp-config
and there's only 2. The other one is the sample. I've even traced the files, from theindex.php
to thewp-config.php
.