Keep Server Online
  
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
  
or
  
 
  
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.
 |    |   
 | 
     Topic: If php is writeable Apache won't execute - howto | 
 |   
| Author | 
  | 
 
liderbug
 
 
  Joined: 30 May 2015 Posts: 5 Location: US, Black Forest
  | 
 Posted: Sat 30 May '15 15:45    Post subject: If php is writeable Apache won't execute - howto | 
     | 
 
  | 
 
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: 7443 Location: EU, Germany, Next to Hamburg
  | 
 Posted: Sat 30 May '15 20:05    Post subject:  | 
     | 
 
  | 
 
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
  | 
 Posted: Sun 31 May '15 1:02    Post subject:  | 
     | 
 
  | 
 
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: 7443 Location: EU, Germany, Next to Hamburg
  | 
 Posted: Mon 01 Jun '15 16:31    Post subject:  | 
     | 
 
  | 
 
??
 
 
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
  | 
 Posted: Mon 01 Jun '15 18:46    Post subject:  | 
     | 
 
  | 
 
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 | 
 | 
 
 
 
 
 | 
 
 
 |  
 
 |  
  |   
 |