Alias in PHP will not parse script

Support/Development for PHP
rolo
New Forum User
New Forum User
Posts: 4
Joined: Wed Dec 28, 2005 11:57 pm

Alias in PHP will not parse script

Unread post by rolo »

Hi,

I'm running a Plesk 7.5.4 server. Fedora Core 2 with PHP 4.4.1 installed from ART's rpms not minutes ago.

I want to have libraries stored in one domain and have other domains access them. I was being able to do this just fine on my previous dedicated server (without plesk) but now I can't. PHP files that are read from aliased directories don't get parsed and the browser shows a "download file" popup.

I added the following to this file /var/www/vhosts/otherdomain.com/conf/vhost.conf:

Code: Select all

Alias /scripts /var/www/vhosts/scriptsdomain.com/httpdocs/scripts
When I go to http://otherdomain.com/scripts/phpinfo.php, I get prompted to download the phpinfo.php file instead of seing its output.

So far I've tried symlinks and a whole bunch of <Directory> entries to no avail. Every time the file IS FOUND but not parsed and the whole source code is dumped to the browser.

How can I solve this?

Thanks,
Rolo
breun
Long Time Forum Regular
Long Time Forum Regular
Posts: 2813
Joined: Sat Aug 20, 2005 9:30 am
Location: The Netherlands

Unread post by breun »

Maybe you need a ScriptAlias instead of a normal Alias?
rolo
New Forum User
New Forum User
Posts: 4
Joined: Wed Dec 28, 2005 11:57 pm

Unread post by rolo »

No, ScriptAlias is used for CGI stuff, but still I tried it too and it didn't work :(

Right now my problem is REALLY weird. I managed to get the scripts parsed with a mixture of +AllowSymlinks in vhosts.conf and a bunch of symlinks. The strange part is that some scripts got cached (or some reason I can't figure out) and get dumped to screen, but some others in the same dir don't. What's even better is that for the scripts that do get cached, if I pass any vars at all to them via GET, they are not cached.

Say the script test.php is one that is getting cached:

Code: Select all

http://www.domain.com/scripts/test.php
The above returns the source code for test.php

Code: Select all

http://www.domain.com/scripts/test.php?

Code: Select all

http://www.domain.com/scripts/test.php?blah

Code: Select all

http://www.domain.com/scripts/test.php?blah=blah
The above return the parsed output of test.php as it normally should.

I checked from my PC at work and from my Mac at home with identical results. I uploaded another test.php script with completely different code. The cached version shows the source code for the original test.php file, and the non cached version works as it should.

As I was writing this I got the idea that maybe this is a software bug. Restarting apache wasn't solving it. Maybe I need to restart the whole box. :(
Post Reply