I'm new to Drupal. I have successfully installed it in root directory and subdirectories without too many problems. I cannot install it in a subdomain. I mean a completely separate installation of the files and a separate database. The install script fails and changes the web browser's address to something that is the file path of the subdomain relative to the virtual server root, rather than the web root. I have even managed to get the address relative to the physical computer's root on one occasion trying various solutions!

The web hosts enquired of ensim and got the following reply

quote

The developers have confirmed that what is occurring is due to PHP correctly reporting the actual location that the script is running from however Drupal is utilizing a PHP variable for the location and is not performing any truncation of the path to consider the top level (install path) as being contained within the /var/subdomain/drupal/html directory as it should.

They have suggested the following as the best solution to work around this:

--------------------------------
In order to resolve this issue your client has to change some of Drupal scripts in a place where I think is a line like "dirname($_SERVER['SCRIPT_NAME']". Please check includes/ directory.
--------------------------------

Basically saying that adjustments of the Drupal scripts are needed to ensure that the path is defined specifically to avoid the variable being used literally.

unquote

Does this make sense? Is there a better way?

Comments

rentex’s picture

Im using Drupal 5.7. What version are you using?

Im encountering similar errors. Seems like this problem doesnt depend on the control panel runned by the server.
Did you understand how to apply the fix? Anyone got some examples?
Why is this an issue only on some servers? Are there alternative ways of fixing this?

Do you replace $_SERVER with the internal server path, or do you have to include the domain as well? Does the path have to be specified from the server-root, or from the subdomain-root? Which files have to be edited?

The following threads are refering to the same issue:
http://drupal.org/node/216172
http://drupal.org/node/239443

rentex’s picture

I found out that it might be FastCGI causing the issue. However there is a patch that fixes the issue over here:
http://drupal.org/node/194331

Here is a direct link to the patch I used: http://drupal.org/files/issues/php_self2.patch

I tested the patch on a Drupal 5.7 website. However the patch might work on other versions as well.