Can't execute PHP scripts

30 posts / 0 new
Last post
#1 Tue, 09/01/2009 - 10:27
Fautzi

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

Tue, 09/01/2009 - 12:55
ronald
ronald's picture

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)

Tue, 09/01/2009 - 13:48
Fautzi

Yes all i have

Tue, 09/01/2009 - 14:48
ronald
ronald's picture

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

Tue, 09/01/2009 - 15:54
Fautzi

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

Tue, 09/01/2009 - 15:57
Fautzi

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

Tue, 09/01/2009 - 18:09
ronald
ronald's picture

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)

Wed, 09/02/2009 - 07:25
Fautzi

Iam not professional in this so i have these directives:

http://pastebin.com/m5e096f7c

It's correct?

Wed, 09/02/2009 - 11:42
ronald
ronald's picture

I made a correction from line 13 til 17

# # Options Indexes IncludesNOEXEC FollowSymLinks ExecCGI # allow from all # AllowOverride All #

Wed, 09/02/2009 - 12:46
Fautzi

It have no effect still not work

Wed, 09/02/2009 - 12:50
ronald
ronald's picture

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.

Wed, 09/02/2009 - 13:27
Fautzi

Yes of course that i restated Apache.

Wed, 09/02/2009 - 14:41
andreychek

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 :-)

-Eric

Wed, 09/02/2009 - 14:57
Fautzi

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

Wed, 09/02/2009 - 19:26 (Reply to #14)
andreychek

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

Wed, 09/02/2009 - 14:59
Fautzi

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

Wed, 09/02/2009 - 18:11
ronald
ronald's picture

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

Thu, 09/03/2009 - 07:20
Fautzi

Yes i always use binary mode And yes html work

Thu, 09/03/2009 - 13:29
Fautzi

It's impossible to solve this

Fri, 09/04/2009 - 14:41
ronald
ronald's picture

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?

Sun, 09/06/2009 - 12:14
Fautzi

I set up suexec directive on NO in default template and php is maybe func but i have bunch of chinese symbols look http://test.clanteam.cz

Sun, 09/06/2009 - 13:45
andreychek

Hmm, that site doesn't work for me unfortunately -- would it be possible to post a screenshot? Thanks!

-Eric

Sun, 09/06/2009 - 14:08
Fautzi

http://i25.tinypic.com/3010gld.png

Here is screenshot in index.php i have simple phpinfo()

Sun, 09/06/2009 - 17:59
ronald
ronald's picture

I'm a little rusty on my Chinese..lol
I think you should set SUexec to yes from a security point of view..

So php started to work after disabling suexec? but only in chinese language, yes?

Mon, 09/07/2009 - 07:00
Fautzi

That's correct if i for example type simple echo "test" the result is 4 or 5 chinese symbols

Mon, 09/07/2009 - 08:38
andreychek

Hrm, it's probably unicode, but can you show us a screenshot of this phenomenon? :-)

That is, I'd like to see what exactly is showing up on the screen when you type "echo test".

Also, what distribution and version are you using?

Thanks!

-Eric

Mon, 09/07/2009 - 10:07
Fautzi

I use Debian Lenny (5.0) BTW Now i log in into FTP and type echo test and save the file on ftp and voila work like a charm problem is solved I love you all

Really big thanks for all

EDIT: And i always USE total commander and binary mode it's strange.

Mon, 09/07/2009 - 11:07
ronald
ronald's picture

the solution was to turn of suexec and recreate a php file? is that correct?

if so I think suexec is not pointing to home and should be recompiled, so you can use it.

Tue, 09/08/2009 - 01:51
Fautzi

Yes that is correct.

And i have one question how can i restrict FTP users only for folder public_html no thers like cgi-bin awstats etc. I want it because i want only simple subdomain hosting not with mysql and ftp no more

Tue, 09/08/2009 - 08:59
andreychek

To restrict an FTP user to just public_html, first make sure that you set things up in Limits and Validation -> FTP Directory Restrictions.

Then, if you create an FTP user by going into Edit Mail and FTP user -> Add a website FTP access user, they'll be locked in whatever directory you set as their home directory.

-Eric

Topic locked