Friday, July 24, 2020

Wordpress warning: Use of undefined constant WP_CONTENT_DIR

After upgrading PHP from version 5 to 7 on my shared hosting server, I've got the following error on my wordpress sites:

Warning: Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP).
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0



As an workaround, I added the following on the wp-config.php before the call to wp-settings.php:
define( 'WP_CONTENT_DIR', ABSPATH . 'wp-content' );



1 comment:

  1. There are two primary advantages to staying up with the latest: Your site will be quicker as the most recent form of PHP is more productive. Refreshing to the most recent upheld form (at present 7.4) can convey a colossal presentation increment; up to 3 or 4x quicker for more established adaptations. Your site will be safer. PHP, as WordPress, is kept up by its local area. Since PHP is so mainstream, it is an objective for programmers – yet the furthest down the line form will have the most recent security highlights. More seasoned variants of PHP don't have this, so refreshing is vital for keep your WordPress site secure.
    for more information click here: HOW TO UPDATE PHP IN WORDPRESS

    ReplyDelete