Re: [users@httpd] PHP Not Working

2011-06-15 Thread Matus UHLAR - fantomas
On 10.06.11 00:03, Jeroen Geilman wrote:
 You need to tell apache what to do with .php files.

 This can be implemented - as documented - by adding

 FilesMatch \.php$
 SetHandler application/x-httpd-php
 /FilesMatch

 in your Documentroot Directory block.

Since when they recomment something different than AddHandler?

-- 
Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
The 3 biggets disasters: Hiroshima 45, Tschernobyl 86, Windows 95

-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] PHP Not Working

2011-06-15 Thread Jeroen Geilman

On 06/15/2011 10:13 PM, Matus UHLAR - fantomas wrote:

On 10.06.11 00:03, Jeroen Geilman wrote:

You need to tell apache what to do with .php files.

This can be implemented - as documented - by adding

FilesMatch \.php$
 SetHandler application/x-httpd-php
/FilesMatch

in your Documentroot Directory block.

Since when they recomment something different than AddHandler?




Who are they ?

The above is the recommended way on the apache httpd wiki: 
http://www.php.net/manual/en/install.unix.apache2.php


We also unerringly advise it on freenode's #httpd channel.

It works.

--
J.


-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
 from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] PHP Not Working

2011-06-15 Thread Matus UHLAR - fantomas
 On 10.06.11 00:03, Jeroen Geilman wrote:
 You need to tell apache what to do with .php files.

 This can be implemented - as documented - by adding

 FilesMatch \.php$
  SetHandler application/x-httpd-php
 /FilesMatch

 in your Documentroot Directory block.

 On 06/15/2011 10:13 PM, Matus UHLAR - fantomas wrote:
 Since when they recomment something different than AddHandler?

On 15.06.11 22:17, Jeroen Geilman wrote:
 Who are they ?

the PHP people apparently...

 The above is the recommended way on the apache httpd wiki:  
 http://www.php.net/manual/en/install.unix.apache2.php

Aha, I see:

Instead of only using the Apache AddType directive, we want to avoid
potentially dangerous uploads and created files such as exploit.php.jpg from
being executed as PHP.

 We also unerringly advise it on freenode's #httpd channel.

Who are we? ;)
-- 
Matus UHLAR - fantomas, uh...@fantomas.sk ; http://www.fantomas.sk/
Warning: I wish NOT to receive e-mail advertising to this address.
Varovanie: na tuto adresu chcem NEDOSTAVAT akukolvek reklamnu postu.
Linux is like a teepee: no Windows, no Gates and an apache inside...

-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] PHP Not Working

2011-06-15 Thread Jeroen Geilman

On 06/15/2011 10:23 PM, Matus UHLAR - fantomas wrote:

On 10.06.11 00:03, Jeroen Geilman wrote:

You need to tell apache what to do with .php files.

This can be implemented - as documented - by adding

FilesMatch \.php$
  SetHandler application/x-httpd-php
/FilesMatch

in your Documentroot Directory block.

On 06/15/2011 10:13 PM, Matus UHLAR - fantomas wrote:

Since when they recomment something different than AddHandler?

On 15.06.11 22:17, Jeroen Geilman wrote:

Who are they ?

the PHP people apparently...


The above is the recommended way on the apache httpd wiki:
http://www.php.net/manual/en/install.unix.apache2.php

Aha, I see:

Instead of only using the Apache AddType directive, we want to avoid
potentially dangerous uploads and created files such as exploit.php.jpg from
being executed as PHP.


We also unerringly advise it on freenode's #httpd channel.

Who are we? ;)


...the regulars on the freenode #httpd channel, obviously.


--
J.


-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
 from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: Re: [users@httpd] PHP Not Working

2011-06-13 Thread zavelopez
Hello and thank you again for your replies thus far. I am still trying to  
get apache to parse php. I ran apache2ctl -L and I don't see php as an  
available module, yet when I do ls /etc/apache2/mods-available, I see the  
php5.conf and php5.load files. Does this information shed any light on my  
dis-configuration?


On , Jeroen Geilman jer...@adaptr.nl wrote:

On 06/10/2011 08:31 PM, zavelo...@gmail.com wrote:



J, I couldn't figure out what exactly you meant when you typed in your  
Documentroot Directory. Did you mean in the block of text that contains  
the DocumentRoot Directive, or the Directory Directive containing the  
document root? I tried it both ways, like so:





ServerName http://new.dev



ServerAdmin webmaster@localhost



DocumentRoot /home/zave/Public/new



RewriteEngine off





SetHandler application/x-httpd-php







AND:







Options Indexes FollowSymLinks MultiViews



AllowOverride All



Order allow,deny



allow from all





SetHandler application/x-httpd-php













Both are valid, but the former means you allow PHP processing anywhere,  
while the latter restricts it to your web content location.







After restarting Apache, neither made any difference. Am I doing it  
incorrectly?






You'd have to show concrete evidence of this.



Run httpd -L to verify the php module is loaded.



Clear the browser cache.







--



J.







-



The official User-To-User support forum of the Apache HTTP Server Project.



See http://httpd.apache.org/userslist.html for more info.



To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org



 from the digest: users-digest-unsubscr...@httpd.apache.org



For additional commands, e-mail: users-h...@httpd.apache.org






Re: Re: [users@httpd] PHP Not Working

2011-06-13 Thread Yehuda Katz
On Mon, Jun 13, 2011 at 11:49 PM, zavelo...@gmail.com wrote:

 Hello and thank you again for your replies thus far. I am still trying to
 get apache to parse php. I ran apache2ctl -L and I don't see php as an
 available module, yet when I do ls /etc/apache2/mods-available, I see the
 php5.conf and php5.load files. Does this information shed any light on my
 dis-configuration?


mods-available is for any module which you have binaries on your server.
You need to enable the module using a2enmod php5 which links it to the
mods-enabled directory.
You could also manually create the necessary symlinks, but I recommend using
the script that will do it for you.

- Yehuda


Re: Re: Re: [users@httpd] PHP Not Working

2011-06-13 Thread zavelopez

But when I do that, it says it's already enabled.

On , Yehuda Katz yeh...@ymkatz.net wrote:

On Mon, Jun 13, 2011 at 11:49 PM, zavelo...@gmail.com wrote:



Hello and thank you again for your replies thus far. I am still trying to  
get apache to parse php. I ran apache2ctl -L and I don't see php as an  
available module, yet when I do ls /etc/apache2/mods-available, I see the  
php5.conf and php5.load files. Does this information shed any light on my  
dis-configuration?





mods-available is for any module which you have binaries on your server.
You need to enable the module using a2enmod php5 which links it to the  
mods-enabled directory.



You could also manually create the necessary symlinks, but I recommend  
using the script that will do it for you.




- Yehuda






RE: [users@httpd] PHP Not Working

2011-06-10 Thread Steve Brereton

What happens when you load a php page?
A blank? the php script shows? a 500 error?

 Date: Thu, 9 Jun 2011 14:48:20 -0700
 From: zavelo...@gmail.com
 To: users@httpd.apache.org
 Subject: [users@httpd] PHP Not Working
 
 Hi, I'm using Apache 2.2 on Ubuntu 10.04. I've checked that php mod is
 enabled. It is. I'm using virtual hosts.  It serves all html files,
 but not php. Following is my VHost configuration:
 
 VirtualHost *:80
 ServerName http://new.dev
   ServerAdmin webmaster@localhost
 DocumentRoot /home/zave/Public/new
 RewriteEngine off
 
 Location /
 RewriteEngine on
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule !\.(js|ico|gif|jpg|png|css)$ /index.php
 /Location
 
   Directory /
   Options FollowSymLinks
   AllowOverride None
   /Directory
 
   Directory /home/zave/Public/new
   Options Indexes FollowSymLinks MultiViews
   AllowOverride All
   Order allow,deny
   allow from all
   /Directory
 
   ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
   Directory /usr/lib/cgi-bin
   AllowOverride None
   Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
   Order allow,deny
   Allow from all
   /Directory
 
   ErrorLog /var/log/apache2/error.log
 
   # Possible values include: debug, info, notice, warn, error, crit,
   # alert, emerg.
   LogLevel warn
 
   CustomLog /var/log/apache2/access.log combined
 
 Alias /doc/ /usr/share/doc/
 Directory /usr/share/doc/
 Options Indexes MultiViews FollowSymLinks
 AllowOverride None
 Order deny,allow
 Deny from all
 Allow from 127.0.0.0/255.0.0.0 ::1/128
 /Directory
 /VirtualHost
 
 All my VHosts are configured the same way, save for the ServerName and
 DocumentRoot directives. Please help.
 
 -
 The official User-To-User support forum of the Apache HTTP Server Project.
 See URL:http://httpd.apache.org/userslist.html for more info.
 To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
   from the digest: users-digest-unsubscr...@httpd.apache.org
 For additional commands, e-mail: users-h...@httpd.apache.org
 
  

Re: RE: [users@httpd] PHP Not Working

2011-06-10 Thread zavelopez
Steve, I get the Firefox alert asking me what program I want it to use to  
open the file.


On , Steve Brereton the.oldg...@hotmail.com wrote:


What happens when you load a php page?
A blank? the php script shows? a 500 error?



 Date: Thu, 9 Jun 2011 14:48:20 -0700
 From: zavelo...@gmail.com
 To: users@httpd.apache.org
 Subject: [users@httpd] PHP Not Working

 Hi, I'm using Apache 2.2 on Ubuntu 10.04. I've checked that php mod is
 enabled. It is. I'm using virtual hosts. It serves all html files,
 but not php. Following is my VHost configuration:


 ServerName http://new.dev
 ServerAdmin webmaster@localhost
 DocumentRoot /home/zave/Public/new
 RewriteEngine off


 RewriteEngine on
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule !\.(js|ico|gif|jpg|png|css)$ /index.php



 Options FollowSymLinks
 AllowOverride None



 Options Indexes FollowSymLinks MultiViews
 AllowOverride All
 Order allow,deny
 allow from all


 ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/

 AllowOverride None
 Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
 Order allow,deny
 Allow from all


 ErrorLog /var/log/apache2/error.log

 # Possible values include: debug, info, notice, warn, error, crit,
 # alert, emerg.
 LogLevel warn

 CustomLog /var/log/apache2/access.log combined

 Alias /doc/ /usr/share/doc/

 Options Indexes MultiViews FollowSymLinks
 AllowOverride None
 Order deny,allow
 Deny from all
 Allow from 127.0.0.0/255.0.0.0 ::1/128



 All my VHosts are configured the same way, save for the ServerName and
 DocumentRoot directives. Please help.

 -
 The official User-To-User support forum of the Apache HTTP Server  
Project.

 See http://httpd.apache.org/userslist.html for more info.
 To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
 For additional commands, e-mail: users-h...@httpd.apache.org






Re: Re: [users@httpd] PHP Not Working

2011-06-10 Thread zavelopez
J, I couldn't figure out what exactly you meant when you typed in your  
Documentroot Directory. Did you mean in the block of text that contains  
the DocumentRoot Directive, or the Directory Directive containing the  
document root? I tried it both ways, like so:


ServerName http://new.dev
ServerAdmin webmaster@localhost
DocumentRoot /home/zave/Public/new
RewriteEngine off
FilesMatch \.php$
SetHandler application/x-httpd-php
/FilesMatch

AND:

Directory /home/zave/Public/new
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
FilesMatch \.php$
SetHandler application/x-httpd-php
/FilesMatch
/Directory

After restarting Apache, neither made any difference. Am I doing it  
incorrectly?


On , Jeroen Geilman jer...@adaptr.nl wrote:

On 06/09/2011 11:48 PM, Xavier Lopez wrote:




Hi, I'm using Apache 2.2 on Ubuntu 10.04. I've checked that php mod is



enabled. It is. I'm using virtual hosts. It serves all html files,



but not php. Following is my VHost configuration:







ServerName http://new.dev



ServerAdmin webmaster@localhost



DocumentRoot /home/zave/Public/new



RewriteEngine off







RewriteEngine on



RewriteCond %{REQUEST_FILENAME} !-f



RewriteCond %{REQUEST_FILENAME} !-d



RewriteRule !\.(js|ico|gif|jpg|png|css)$ /index.php









Options FollowSymLinks



AllowOverride None








You are allowing apache full access to your OS root directory.



Don't do that.








Options Indexes FollowSymLinks MultiViews



AllowOverride All



Order allow,deny



allow from all







ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/





AllowOverride None



Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch



Order allow,deny



Allow from all







ErrorLog /var/log/apache2/error.log





# Possible values include: debug, info, notice, warn, error, crit,



# alert, emerg.



LogLevel warn





CustomLog /var/log/apache2/access.log combined





Alias /doc/ /usr/share/doc/





Options Indexes MultiViews FollowSymLinks



AllowOverride None



Order deny,allow



Deny from all



Allow from 127.0.0.0/255.0.0.0 ::1/128









All my VHosts are configured the same way, save for the ServerName and



DocumentRoot directives. Please help.








I see nothing related to handling PHP.



You need to tell apache what to do with .php files.





This can be implemented - as documented - by adding







SetHandler application/x-httpd-php







in your Documentroot Directory block.







--



J.







-



The official User-To-User support forum of the Apache HTTP Server Project.



See http://httpd.apache.org/userslist.html for more info.



To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org



 from the digest: users-digest-unsubscr...@httpd.apache.org



For additional commands, e-mail: users-h...@httpd.apache.org






Re: Re: [users@httpd] PHP Not Working

2011-06-10 Thread zavelopez
J, regarding your statement, You are allowing apache full access to your  
OS root directory.
Don't do that. I have a follow up question (or several hundred). I looked  
into the output of phpinfo() and saw that the pwd in the 'Environment'  
category = /. Which specifically confirms your point, if I'm not mistaken?  
So I changed the DocumentRoot Directive in the VHost config  
from '/home/zave/Public/new', to '/new', but then the server tells me that  
that directory 'doesn't exist.' What am I doing wrong?


On , Jeroen Geilman jer...@adaptr.nl wrote:

On 06/09/2011 11:48 PM, Xavier Lopez wrote:




Hi, I'm using Apache 2.2 on Ubuntu 10.04. I've checked that php mod is



enabled. It is. I'm using virtual hosts. It serves all html files,



but not php. Following is my VHost configuration:







ServerName http://new.dev



ServerAdmin webmaster@localhost



DocumentRoot /home/zave/Public/new



RewriteEngine off







RewriteEngine on



RewriteCond %{REQUEST_FILENAME} !-f



RewriteCond %{REQUEST_FILENAME} !-d



RewriteRule !\.(js|ico|gif|jpg|png|css)$ /index.php









Options FollowSymLinks



AllowOverride None








You are allowing apache full access to your OS root directory.



Don't do that.








Options Indexes FollowSymLinks MultiViews



AllowOverride All



Order allow,deny



allow from all







ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/





AllowOverride None



Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch



Order allow,deny



Allow from all







ErrorLog /var/log/apache2/error.log





# Possible values include: debug, info, notice, warn, error, crit,



# alert, emerg.



LogLevel warn





CustomLog /var/log/apache2/access.log combined





Alias /doc/ /usr/share/doc/





Options Indexes MultiViews FollowSymLinks



AllowOverride None



Order deny,allow



Deny from all



Allow from 127.0.0.0/255.0.0.0 ::1/128









All my VHosts are configured the same way, save for the ServerName and



DocumentRoot directives. Please help.








I see nothing related to handling PHP.



You need to tell apache what to do with .php files.





This can be implemented - as documented - by adding







SetHandler application/x-httpd-php







in your Documentroot Directory block.







--



J.







-



The official User-To-User support forum of the Apache HTTP Server Project.



See http://httpd.apache.org/userslist.html for more info.



To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org



 from the digest: users-digest-unsubscr...@httpd.apache.org



For additional commands, e-mail: users-h...@httpd.apache.org






Re: [users@httpd] PHP Not Working

2011-06-10 Thread Jeroen Geilman

On 06/10/2011 08:31 PM, zavelo...@gmail.com wrote:
J, I couldn't figure out what exactly you meant when you typed in 
your Documentroot Directory. Did you mean in the block of text that 
contains the DocumentRoot Directive, or the Directory Directive 
containing the document root? I tried it both ways, like so:


ServerName http://new.dev
ServerAdmin webmaster@localhost
DocumentRoot /home/zave/Public/new
RewriteEngine off
FilesMatch \.php$
SetHandler application/x-httpd-php
/FilesMatch

AND:

Directory /home/zave/Public/new
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
FilesMatch \.php$
SetHandler application/x-httpd-php
/FilesMatch
/Directory




Both are valid, but the former means you allow PHP processing anywhere, 
while the latter restricts it to your web content location.



After restarting Apache, neither made any difference. Am I doing it 
incorrectly?


You'd have to show concrete evidence of this.
Run httpd -L to verify the php module is loaded.
Clear the browser cache.


--
J.


-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
 from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[users@httpd] PHP Not Working

2011-06-09 Thread Xavier Lopez
Hi, I'm using Apache 2.2 on Ubuntu 10.04. I've checked that php mod is
enabled. It is. I'm using virtual hosts.  It serves all html files,
but not php. Following is my VHost configuration:

VirtualHost *:80
ServerName http://new.dev
ServerAdmin webmaster@localhost
DocumentRoot /home/zave/Public/new
RewriteEngine off

Location /
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\.(js|ico|gif|jpg|png|css)$ /index.php
/Location

Directory /
Options FollowSymLinks
AllowOverride None
/Directory

Directory /home/zave/Public/new
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
/Directory

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
Directory /usr/lib/cgi-bin
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
/Directory

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

Alias /doc/ /usr/share/doc/
Directory /usr/share/doc/
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
/Directory
/VirtualHost

All my VHosts are configured the same way, save for the ServerName and
DocumentRoot directives. Please help.

-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [users@httpd] PHP Not Working

2011-06-09 Thread Jeroen Geilman

On 06/09/2011 11:48 PM, Xavier Lopez wrote:

Hi, I'm using Apache 2.2 on Ubuntu 10.04. I've checked that php mod is
enabled. It is. I'm using virtual hosts.  It serves all html files,
but not php. Following is my VHost configuration:

VirtualHost *:80
 ServerName http://new.dev
ServerAdmin webmaster@localhost
 DocumentRoot /home/zave/Public/new
 RewriteEngine off

 Location /
 RewriteEngine on
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule !\.(js|ico|gif|jpg|png|css)$ /index.php
 /Location

Directory /
Options FollowSymLinks
AllowOverride None
/Directory


You are allowing apache full access to your OS root directory.
Don't do that.


Directory /home/zave/Public/new
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
/Directory

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
Directory /usr/lib/cgi-bin
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
/Directory

ErrorLog /var/log/apache2/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/access.log combined

 Alias /doc/ /usr/share/doc/
 Directory /usr/share/doc/
 Options Indexes MultiViews FollowSymLinks
 AllowOverride None
 Order deny,allow
 Deny from all
 Allow from 127.0.0.0/255.0.0.0 ::1/128
 /Directory
/VirtualHost

All my VHosts are configured the same way, save for the ServerName and
DocumentRoot directives. Please help.



I see nothing related to handling PHP.
You need to tell apache what to do with .php files.

This can be implemented - as documented - by adding

FilesMatch \.php$
SetHandler application/x-httpd-php
/FilesMatch

in your Documentroot Directory block.


--
J.


-
The official User-To-User support forum of the Apache HTTP Server Project.
See URL:http://httpd.apache.org/userslist.html for more info.
To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org
 from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org