You are not logged in.

#1 2011-11-06 22:32:01

lightstream
Member
From: Britain
Registered: 2011-10-30
Posts: 64

PHP files in symlinked directory being served as plain text

I've installed apache and PHP (with MySQL) following the instructions at https://wiki.archlinux.org/index.php/LAMP

Everything seems to be working OK - I can view files in /svr/http by navigating to http://localhost, and PHP files in that location or in physical subdirectories off it are served correctly (with the PHP being executed and the expected HTML being sent to the browser)

The problem is with a website which I have in my home directory. I have created a symlink in /svr/http to this directory, and I added the http user to the users group, and I set my home folder to allow group access with chmod 750 /home/myusername. Apache can now access the files, and serves HTML etc correctly.

When I access a PHP file in the symlinked directory, it comes up as plaintext ie View Source shows the PHP source code unmodified.

I'm really stumped as to how this is happening! I can't find a clue as to what I may have missed here - could it be that PHP is running under a different user to apache or something like that? I believe PHP is running as an apache module not CGI, but I'm not used to the Arch way of setting up apache - I've had systems where the web root is at /var/www by default or sometimes somewhere under /usr but to be honest I've never encountered this /svr directory before!

I'd be glad of any help as I'm banging my head againsta wall here.

Edit: I've also set up an Alias and Directory in httpd.conf but this gets the exact same behaviour - ie all files come through as text

Last edited by lightstream (2011-11-06 22:36:25)

Offline

#2 2011-11-09 22:30:39

lightstream
Member
From: Britain
Registered: 2011-10-30
Posts: 64

Re: PHP files in symlinked directory being served as plain text

Problem was because Arch's default php.ini has short tags disabled by default.

Offline

Board footer

Powered by FluxBB