Installer issue – function wp_guess_url() guesses wrong
-
There seems to be a symlink-related issue with function
wp_guess_url()
inwp-includes/functions.php
that causes the WordPress 3.7 installer script to create a wrong URL on the initial WordPress setup page on our webservers.Webserver setup:
CentOS 5.10, Apache Version 2.2.24, PHP Version 5.3.26 (via custom suExec CGI), Apache Virtualhost DocumentRoot for “domain.com” is “/homepages/domain.com/”, WordPress 3.7 installed in “/homepages/domain.com/wordpress”.I can access WordPress in my browser under “https://domain.com/wordpress/” and see that it complains “There doesn’t seem to be a wp-config.php file.” However, the button “Create Configuration File” links to URL “https://domain.com/wordpress/vrmd/wp-admin/setup-config.php”, but the URL should be “https://domain.com/wordpress/wp-admin/setup-config.php” (without “vrmd”).
I guess the problem is that the “/homepages”-directory on our webservers is a symlink to “/vrmd/homepages” and the Apache DocumentRoot uses this symlink. The WordPress installer uses function
wp_guess_url()
to determine filesystem path and URL, and two different PHP functions are used to determine the path of the current script that return different results:dirname(__FILE__)
returns “/vrmd/homepages/domain.com/wordpress”
dirname($_SERVER['SCRIPT_FILENAME']
returns “/homepages/domain.com/wordpress”
- The topic ‘Installer issue – function wp_guess_url() guesses wrong’ is closed to new replies.