Opened 5 years ago
Closed 5 years ago
#7221 closed defect (bug) (fixed)
PHP notice "WP_CONTENT_DIR undefined" occurs when creating wp-config.php
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| 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 (1)
Change History (5)
- 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.
- Keywords has-patch installer added; setup-config removed
- 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.

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.