The MU forums have moved to

Unknown subdir inserted in welcome email links etc.? (6 posts)

  1. dgilmour
    Posted 17 years ago #


    Apologies for this long post but I want to provide enough info for you, and I'm not sure what you'll need. I've been trying for a week to install WPMU-1.0-rc4 into a sub directory (/wpmu), choosing subdomains not subdirs. Instead of subdir /wpmu, the email links, .htaccess and database path fields contain /execscriptdir.

    I've followed instructions in readme.txt file.
    I've used ISP's control panel to add A DNS record, think that's OK. (I had to use prefix blank (not *)
    as their control panel would not accept *.

    Install appears to go OK. I can see database tables are created and populated. No error messages are received, and email arrives.

    * Problem symptoms are *
    1. "Created" Link provided in email (http://<name> generates the error message:
    "Forbidden, perhaps you need to change the file permissions for this document or upload an index page."
    Apache's error log records:
    [Sun Sep ...] [error] [client...] attempt to invoke directory as script: /execscriptdir

    2. Login: link in email (http://<name> generates error message:
    Internal Server Error, this is an error with your script, check your error log for more information.
    Apache's error log records:
    [Sun ...] [error] [client ...] Premature end of script headers: /execscriptdir/php.cgi

    I've spent a lot of time in WPMU forum, but haven't been able to get to the point where I understand what's going wrong.
    There are many similar posts, but I haven't found one that enables me to fix it.

    * Things I have found out:*
    1. Email uses unknown dir "execscriptdir" not /wpmu. It includes:
    - "Your new WPMU site has been created at http://<domain>"
    - "Login: http://<domain>"

    2. I can see that execscriptdir also finds it's way into:
    - Table wp_site, column path.
    - Table wp_blogs, row blog_id 1, column path.
    - .htaccess file that's created during install.

    3. The .htaccess that's created includes execscriptdir in RewriteBase. It looks like this:
    RewriteEngine On
    RewriteBase /execscriptdir/

    # Rewrite to
    RewriteCond %{HTTP_HOST} ^www\.(.*)
    RewriteRule ^(.*) http://%1/$1 [R,L]

    #uploaded files
    RewriteRule ^(.*)?/?files/(.*) wp-content/blogs.php?file=$2 [L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule . - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-.*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]

    4. The wp-config.php that's created includes a reference to execscriptdir, see below:
    // ** MySQL settings ** //
    define('DB_NAME', 'wordpress'); // The name of the database
    define('DB_USER', 'wordpress'); // Your MySQL username
    define('DB_PASSWORD', '<password>'); // ...and password
    define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value
    define('VHOST', 'yes');
    $base = '/execscriptdir/';

    I've spent a lot of time checking wpmu installation forum but am starting to think less clearly now as this continues.
    I guess the problem arises from host config. Host has a top-level directory /execscriptdir containing php.cgi and php5.cgi.

    5. Site is in /home/d/g/dgilmour/public_html. Apache httpd.conf contains:

    <Directory /domains/*/*/*/public_html>
    AllowOverride All
    # FollowSymLinks added to next line, WPMU needs. DRG 28-Aug-2006
    Options IncludesNoExec ExecCGI FollowSymLinks

    # ServerAlias *
    # ds3120 name used only for Control Panel access on * DRG, 2-Sep-06 ***
    # ServerName
    ErrorLog /var/log/error_log
    CustomLog /var/log/sites_access_log ald
    # *** temporary change, add line for debugging wpmu, DRG 2-Sep-06
    LogLevel debug
    # temporary addition for wpmu debug, ******************************** DRG, 30-aug-06
    TransferLog /var/log/system_transfer_log
    VirtualDocumentRoot /domains/%1.1/%1.2/%0/public_html
    User nobody
    Group sites

    6. execscriptdir is referenced in these parts of httpd.conf, in this order:

    <IfModule mod_alias.c>
    ScriptAlias /execscriptdir/ "/execscriptdir/"

    <IfModule mod_mime.c>
    AddHandler php .php .php3 .php4
    Action php /execscriptdir/php.cgi
    AddHandler php5 .php5
    Action php5 /execscriptdir/php5.cgi


    It's also referenced in a vhost for SSL, but I've proved that's not contributing by commenting it out.

    Environment is:
    PHP 4.4.2
    FreeBSD 4.11-STABLE #7
    MySQL client API version 4.1.19
    Apache 1.3(.31?) I forget how to check..

    I hope you can help. Thanks for taking the time to read.

  2. dgilmour
    Posted 17 years ago #

    Sorry, login link in email should also have included /execscriptdir, like this:


    Have I put too much info in this post?

    Can anyone offer any clues where the "/execscriptdir" that's being added into links etc might be coming from?

  3. drmike
    Posted 17 years ago #

    A quick search tells me that execscriptdir is created when php is run as a CGI. Is this how php is installed on your box?

    You will note that WPMU thinks you have installed it's files within execscriptdir/ from the htaccess file. If that's not true, you should correct it.

  4. dgilmour
    Posted 17 years ago #

    Thanks, drmike. You're right, php is run as a CGI.

    I'd noticed the line "RewriteBase /execscriptdir/" (no quotes) in the .htaccess file, and tried correcting it, along with the other instances I've found (wp-config.php and database tables wp_site & wp_blogs).

    So far this hasn't been successful, but maybe there are other places I need to look. This goes against the grain, though. I'd prefer to understand the cause and fix that to get a clean, easily maintainable installation if I can. Or is this par for the course?

    I've also found this info using phpinfo():
    _SERVER["SCRIPT_FILENAME"] /execscriptdir/php.cgi
    _SERVER["SCRIPT_NAME"] /execscriptdir/php.cgi

    Planning to try:
    - search website directories for any other files containing execscriptdir
    - correct all instances and watch Apache log files for errors
    - confirm PHP CGI config is correct, perhaps testing it with another app (WordPress?)

    Thanks again for your help. I look forward to getting WPMU running - I heard more great feedback at a conference on social software in education this week!

  5. dgilmour
    Posted 17 years ago #

    This site is on a dedicated server. I've now asked the hosting company to change PHP to run as an Apache module, which is planned to happen tomorrow. It's clear that this is the way most people run: it will take me onto a more well-trodden path.

    As this will avoid the problem, I'm now setting this to Resolved.

  6. drmike
    Posted 17 years ago #

    Glad you're able to. Gotta admit that I was at a loss on this one.

About this Topic