Web Hosting Talk







View Full Version : php apache


Shyne
03-30-2002, 04:26 AM
Hi I got some php apache problem. the machine is running plesk.

When i run http://domain.com/~user/index.php the PHP file is loading fine. When i run http://user.domain.com the PHP file just shows a blank page. It only shows a blank page if i run a PHP files. All other files load.

serve-you
03-30-2002, 04:31 AM
Make sure that you add index.php to your DirectoryIndex line in your httpd.conf.

-Dan

Shyne
03-30-2002, 05:15 PM
it's nost just index.php, any php file shows up blank.

serve-you
03-30-2002, 05:50 PM
Did you enable php for the domain in PSA? Also make sure that you have the following in your httpd.conf:
# And for PHP 4.x, use:
#
AddType application/x-httpd-php .php .php4 .php3
AddType application/x-httpd-php-source .phps

Shyne
03-30-2002, 06:31 PM
yep, i got all that.

Noldar
03-30-2002, 06:35 PM
How are you setting up the subdomain? Are you doing it through the Plesk Control Panel or are you setting it up manually?

Richard

Shyne
03-30-2002, 06:48 PM
i got a wildcard setup.

* 14400 IN CNAME domain.com.

Noldar
03-30-2002, 07:37 PM
A wildcard DNS entry will just point subdomain.domain.com to the same document root as domain.com.

You must be doing something in addition to that to point subdomain.domain.com to a subdirectory. There are several different way to do this. If you can tell us which method you are using it might give a clue as to why php files are not working correctly.

Richard

Shyne
03-30-2002, 08:03 PM
I use the wild card and also mass virtual hosting in my httpd.conf(http://httpd.apache.org/docs/vhosts/mass.html).

Noldar
03-30-2002, 08:54 PM
It sounds like maybe the php engine is not on for the mass virtual hosts. Do the configuration commands for the mass virtual hosting go inside a <VirtualHost> block? If they do you might try adding this inside that block.

<IfModule mod_php4.c>
php_admin_flag engine on
</IfModule>

If not, you could try adding this to the end of your httpd.conf file after the 'Include conf/httpd.include' line. This would enable php globally.


Richard

Shyne
03-30-2002, 09:29 PM
I tried that method at first also, but it didn't work. It should though.

Noldar
03-30-2002, 10:22 PM
Strange.

Do you have any messages showing up in the error log?

Do you have php installed as a standalone also? If you do you could try running the php file as a cgi just to verify that it's an apache configuration problem.

Richard

Shyne
03-30-2002, 10:27 PM
error_log shows nothing, but access_log shows as a successful attempt.

How do run php as a CGI? do i have to recompile apache with such support?

Noldar
03-30-2002, 11:03 PM
You run it just like a perl cgi script. Add the following to the beginning of the file:

#!/usr/local/bin/php

And change the extension to .cgi. You may have to install the standalone version of php. It's not installed by default on FreeBSD. I don't know if it is installed by default for Linux.

Richard

Shyne
03-31-2002, 12:31 AM
I can't seem to find the php binary. Does plesk store it some where else? I don't want to recompile new PHP, because i know Plesk systems give a lot of trouble, and that will cause even more problems. Is there any other type of test i can run?

Noldar
03-31-2002, 10:57 AM
You just need to install the binary. If you're running Red Hat you can grab the rpm. If your running FreeBSD you can get it from the ports collection.

You may also want to post your problem in the Plesk forums. There are several folks there that have come up with different ways to add subdomains and may have run across your problem before.

Richard