These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for Can't execute PHP scripts on the new forum.
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
# # 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 :-)
-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
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
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
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?
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
Hmm, that site doesn't work for me unfortunately -- would it be possible to post a screenshot? Thanks!
-Eric
http://i25.tinypic.com/3010gld.png
Here is screenshot in index.php i have simple phpinfo()
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?
That's correct if i for example type simple echo "test" the result is 4 or 5 chinese symbols
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
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.
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.
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
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