Ticket #7221 (closed defect: fixed)

Opened 5 months ago

Last modified 5 months ago

PHP notice "WP_CONTENT_DIR undefined" occurs when creating wp-config.php

Reported by: lilyfan Assigned to: sambauers
Priority: high Milestone: 2.6
Component: General Version: 2.6
Severity: critical Keywords: has-patch, installer
Cc:

Description

The first step of installing: wordpress can create a wp-config.php file with setup-config.php. In this step, WP_CONTENT_DIR is not defined. But wp-includes/functions.php does not cosider the situation. So, a PHP notice occures: Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' in /home/***/public_html/wp-includes/functions.php on line 1988

To solve the problem: change line 1988 of wp-includes/fuctions.php below: if (defined('WP_CONTENT_DIR') && file_exists( WP_CONTENT_DIR . '/db.php' ) )

Attachments

define_wp_content_dir_for_install.patch (0.7 kB) - added by sambauers on 07/02/08 09:38:31.

Change History

07/02/08 05:19:04 changed by DD32

To solve the problem: change line 1988 of wp-includes/fuctions.php below: if(defined('WP_CONTENT_DIR') && file_exists( WP_CONTENT_DIR . '/db.php' ) )

Only problem with that, Is that to install, it means the user *must* use mysql/default database.

A better solution would be for the install script to define the new definitions at a best-guess i think.

07/02/08 09:17:33 changed by sambauers

  • owner changed from anonymous to sambauers.

DD32 is probably right about defining a best guess at that early stage, either that or skip that part during install. I'll look into it.

07/02/08 09:38:31 changed by sambauers

  • attachment define_wp_content_dir_for_install.patch added.

07/02/08 09:41:20 changed by sambauers

  • keywords changed from setup-config to has-patch, installer.
  • severity changed from normal to critical.

Patch defines WP_CONTENT_DIR at the start of setup-config.php along with the others. That should fix it.

07/02/08 17:03:56 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [8238]) Define WP_CONTENT_DIR in setup-config.php. Props sambauers. fixes #7221