logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: If php is writeable Apache won't execute - howto
Author
liderbug



Joined: 30 May 2015
Posts: 5
Location: US, Black Forest

PostPosted: Sat 30 May '15 15:45    Post subject: If php is writeable Apache won't execute - howto Reply with quote

Apache ver: n/a (well later on Linux)

History: Php web pages were being prefixed with a base64 line by hackers. chmod 444 *.php stopped the practice.

My old hosting company was able to cause Apache NOT to execute a php file if the file was writeable. I can not find any reference as to how to do that.

Thanks
bug
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7301
Location: Germany, Next to Hamburg

PostPosted: Sat 30 May '15 20:05    Post subject: Reply with quote

You can disable it if you only run php as module in apache. Then you might delete

in /usr/bin/

php php5 php5-cgi php-cgi


That might cause consequenses that I'm not aware of. Do it at your own risk.
Back to top
liderbug



Joined: 30 May 2015
Posts: 5
Location: US, Black Forest

PostPosted: Sun 31 May '15 1:02    Post subject: Reply with quote

That would work but on my old server(hoster) php from the command line worked. But http... file.php (with 665) errors out.

bug
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7301
Location: Germany, Next to Hamburg

PostPosted: Mon 01 Jun '15 16:31    Post subject: Reply with quote

??

You want to disable PHP on the webserver but it should run on the command line or what are you trying so say? or do you mean Option ExecCGI[1] ??




[1] http://httpd.apache.org/docs/2.4/howto/cgi.html
Back to top
liderbug



Joined: 30 May 2015
Posts: 5
Location: US, Black Forest

PostPosted: Mon 01 Jun '15 18:46    Post subject: Reply with quote

No ls -l gives:
-rw-rw-r-- 1 blackfor blackfor 908 Jan 14 2011 bfnumbers.php
http://mysite.com/bfnumbers.php returns:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster@blackforest-co.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
----------------------

However
-r--r--r-- 1 blackfor blackfor 908 Jan 14 2011 bfnumbers.php
and the page pops right up.
Back to top


Reply to topic   Topic: If php is writeable Apache won't execute - howto View previous topic :: View next topic
Post new topic   Forum Index -> Apache