PHP doesn't work with custom root path...

4 posts / 0 new
Last post
#1 Wed, 11/25/2009 - 07:25
Hubert J. Farnsworth

PHP doesn't work with custom root path...

Hi everyone, I failed to find my answer by searching on this forum. Please help out.

First, my configuration:
- CentOS 5.4, default installation + AMP related packages
- Virtualmin GPL
- suEXEC is disabled
- root path of my Virtual host: /home/< Virtual host >/public_html/

My issue is PHP related:
1)
I tried to confirm that PHP is working, with:
------------
<?
phpinfo();
?>
------------

My server only outputs a blank page with no error (I already have "display_errors" on). I checked my httpd logs, didn't see anything relevant to my issue.

If I changed the root path to "/var/www/html/" then my server would output the above script correctly.

What should I do in order to get PHP works with my custom root path?

Thanks for the help.

Wed, 11/25/2009 - 09:55
andreychek

I'd recommend looking at the logs in both /var/log/httpd/error_log as well as the Virtual Server logs in $HOME/logs/error_log.

It's hard to say for sure from the info above -- though, have you attempted setting up suexec? Having that makes things a bit nicer in general -- both being more secure as well as resolving a variety of permissions issues that can creep up.

There's a thread on enabling suexec on Virtualmin GPL here:

http://www.virtualmin.com/node/8462

Tue, 12/01/2009 - 22:06
Hubert J. Farnsworth

Hi andreychek, thanks for your reply.

1)
I have messed with my box a bit more before getting back to this thread.

While my issues persisted, everytime I checked my webpages in questions, I first deleted all contents in the logs, to have them easier for reading. For sure didn't see anything relevant to my issues.

I have reinstalled everything (CentOS, Webmin, phpMyAdmin, Virtualmin) from scratch on my home box, for like twice, and no luck.

Then for the third time, I installed my home box as in the following sequence (which was about the same as before...):

- CentOS 5.4 (default + AMP packages)
- Webmin
- phpMyAdmin
- Setting password for MySQL root
- Virtualmin

and somehow my issues are gone. I then installed my VPS the same way, and things are working fine.

While I have a working installation now, I didn't find out what was going on. I don't know, it is just weird...

2)
As for using suEXEC, while I am learning how things work, I would like to use the packages from the default repositories, instead of using Virtualmin's recompiled version of Apache (even though it is just with some fixed paths).

For now I am just messing with my VPS, and trying to have the basic stuffs working properly, so the extra performance & security gains from suEXEC are not important for me.

Thanks again for your reply.

Wed, 12/02/2009 - 07:39
andreychek

While I have a working installation now, I didn't find out what was going on. I don't know, it is just weird...

Well, I'm glad it's working, though it's always just a bit nicer when you know what's gone awry! :-)

For now I am just messing with my VPS, and trying to have the basic stuffs working properly, so the extra performance & security gains from suEXEC are not important for me.

Sure, not everyone needs what suexec offers.

Have a good one!

-Eric

Topic locked