Can't execute PHP scripts

Hi i have a problem i used Virtualmin GPL version and if i add some php files for example simple echo and copy to public_html then i visit url i can see the php script in source what is problem to solve this?

This is the sample URL: http://test.clanteam.cz

PS: Sorry for my bad english

do you have php installed? you can check in a terminal with php -v

Do you have index.php in the Directory index files (webmin-Servers-Apache Webserver-click the virtual server-Directory Indexing)

Yes all i have

are the permissions of the index.php 644 ?
what’s in the logs?

Yes perm is 644 and log of apache:

[Mon Aug 31 22:51:50 2009] [notice] Graceful restart requested, doing restart
[Mon Aug 31 22:51:51 2009] [notice] Digest: generating secret for digest authentication …
[Mon Aug 31 22:51:51 2009] [notice] Digest: done
[Mon Aug 31 22:51:52 2009] [notice] Apache/2.2.9 (Debian) DAV/2 SVN/1.5.1 PHP/5.2.6-1+lenny3 with Suhosin-Patch mod_ruby/1.2.6 Ruby/1.8.7(2008-08-11) mod_ssl/2.2.9 OpenSSL/0.9.8g configured – resuming normal operations
[Mon Aug 31 22:51:52 2009] [error] proxy: ap_get_scoreboard_lb(0) failed in child 4113 for worker proxy:reverse
[Mon Aug 31 22:51:52 2009] [error] proxy: ap_get_scoreboard_lb(0) failed in child 4114 for worker proxy:reverse
[Mon Aug 31 22:51:52 2009] [error] proxy: ap_get_scoreboard_lb(0) failed in child 4115 for worker proxy:reverse
[Mon Aug 31 22:51:52 2009] [error] proxy: ap_get_scoreboard_lb(0) failed in child 4116 for worker proxy:reverse
[Mon Aug 31 22:51:52 2009] [error] proxy: ap_get_scoreboard_lb(0) failed in child 4117 for worker proxy:reverse
[Mon Aug 31 22:52:37 2009] [error] proxy: ap_get_scoreboard_lb(0) failed in child 4118 for worker proxy:reverse
[Mon Aug 31 22:52:46 2009] [error] proxy: ap_get_scoreboard_lb(0) failed in child 4119 for worker proxy:reverse
[Mon Aug 31 23:29:10 2009] [notice] caught SIGTERM, shutting down
[Mon Aug 31 23:29:13 2009] [notice] suEXEC mechanism enabled (wrapper: /usr/lib/apache2/suexec)
[Mon Aug 31 23:29:13 2009] [notice] Digest: generating secret for digest authentication …
[Mon Aug 31 23:29:13 2009] [notice] Digest: done
[Mon Aug 31 23:29:13 2009] [notice] Apache/2.2.9 (Debian) DAV/2 SVN/1.5.1 PHP/5.2.6-1+lenny3 with Suhosin-Patch mod_ruby/1.2.6 Ruby/1.8.7(2008-08-11) mod_ssl/2.2.9 OpenSSL/0.9.8g configured – resuming normal operations

And i forgot for this:

[Mon Aug 31 22:53:57 2009] [error] [client 85.132.202.244] Directory index forbidden by Options directive: /home/test/public_html/
[Mon Aug 31 22:53:59 2009] [error] [client 85.132.202.244] Directory index forbidden by Options directive: /home/test/public_html/
[Mon Aug 31 22:53:59 2009] [error] [client 85.132.202.244] Directory index forbidden by Options directive: /home/test/public_html/
[Mon Aug 31 22:54:01 2009] [error] [client 85.132.202.244] Directory index forbidden by Options directive: /home/test/public_html/
[Mon Aug 31 22:54:01 2009] [error] [client 85.132.202.244] Directory index forbidden by Options directive: /home/test/public_html/
[Mon Aug 31 22:54:02 2009] [error] [client 85.132.202.244] Directory index forbidden by Options directive: /home/test/public_html/
[Tue Sep 01 00:13:58 2009] [error] [client 85.132.202.244] File does not exist: /home/test/public_html/favicon.ico
[Tue Sep 01 13:28:48 2009] [error] [client 85.132.202.244] File does not exist: /home/test/public_html/favicon.ico
[Tue Sep 01 13:28:51 2009] [error] [client 85.132.202.244] File does not exist: /home/test/public_html/favicon.ico
[Tue Sep 01 17:05:51 2009] [error] [client 85.132.202.244] File does not exist: /home/test/public_html/favicon.ico
[Tue Sep 01 17:05:54 2009] [error] [client 85.132.202.244] File does not exist: /home/test/public_html/favicon.ico
[Tue Sep 01 19:51:32 2009] [error] [client 87.212.46.217] File does not exist: /home/test/public_html/favicon.ico
[Tue Sep 01 19:51:35 2009] [error] [client 87.212.46.217] File does not exist: /home/test/public_html/favicon.ico
[Tue Sep 01 20:43:39 2009] [error] [client 85.132.202.244] File does not exist: /home/test/public_html/favicon.ico
[Tue Sep 01 20:43:42 2009] [error] [client 85.132.202.244] File does not exist: /home/test/public_html/favicon.ico
[Tue Sep 01 21:43:56 2009] [error] [client 87.212.46.217] File does not exist: /home/test/public_html/favicon.ico
[Tue Sep 01 21:43:59 2009] [error] [client 87.212.46.217] File does not exist: /home/test/public_html/favicon.ico
[Tue Sep 01 21:45:56 2009] [error] [client 87.212.46.217] script ‘/home/test/public_html/Index.php’ not found or unable to stat

21:45:56 2009] [error] [client 87.212.46.217] script ‘/home/test/public_html/Index.php’ not found or unable to stat

Directory index forbidden by Options directive: /home/test/public_html/

i would double-check the directives in your apache config for the domain. (virtualhost container)

Iam not professional in this so i have these directives:

http://pastebin.com/m5e096f7c

It’s correct?

I made a correction from line 13 til 17

<Directory /home/test/public_html>

Options Indexes IncludesNOEXEC FollowSymLinks ExecCGI

allow from all

AllowOverride All

It have no effect still not work

Ill assume you have restarted Apache after the change? Else I think its time for Eric to chime in on this thread. The rest of the settings look okay to me.

Yes of course that i restated Apache.

Hrm, so there’s a lot that’s gone on here so far – can you summarize what the problem is again?

I see the issue initially is that the source is being displayed rather than the PHP being executed – but the errors in the logfile above would all cause a 403 Forbidden error.

So I’m confused as to what the current problem is :slight_smile:

-Eric

I normally install Virtualmin on clean debian and i wanna do some subdomains so i created and when i upload PHP scripts on html_public folder it cannot executed so iam confused as you. I don’t know what problem is it with clean php and mysql its all fine

Iam so angry so if you wanna a root login on ssh i can give it to you because iam totally crashed with headache.

Did you upload the php files in binary mode? If you use ascii mode then those files may get corrupted.
Do static pages work? like index.html

So to clarify –

are you saying that the current problem is still that your PHP scripts are showing the source code rather than executing?

Or are you receiving some other sort of error?

-Eric

Yes i always use binary mode
And yes html work

It’s impossible to solve this

actually: Directory index forbidden by Options directive: /home/test/public_html/ shows in the logs when there is no file under the public_html.
If that would be the case, you would then normally see the default noindex.html under /var/www/error

Since we can see your index.php but it doesn’t execute I have the feeling an Apache setting isn’t correct.
Is Suexec configured to point at /home by the way?