WordPress.org

Ready to get started?Download WordPress

Forums

Installer issue - function wp_guess_url() guesses wrong (2 posts)

  1. Tobias79
    Member
    Posted 10 months ago #

    There seems to be a symlink-related issue with function wp_guess_url() in wp-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 "http://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 "http://domain.com/wordpress/vrmd/wp-admin/setup-config.php", but the URL should be "http://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"

  2. damian.smith
    Member
    Posted 10 months ago #

    I had the same issue and submitted a ticket based on this... for now the way to resolve is too put

    define('WP_SITEURL', 'http://www.yourdomain.co.uk');
    define('WP_HOME', 'http://www.yourdomain.co.uk');

    into your wp-config.php

Reply

You must log in to post.

About this Topic

Tags

No tags yet.