apache+PHP problem

apache+PHP problem

Post by artemi » Sat, 09 Nov 2002 01:07:53



Hao!

I have problems making my apache (2.0.35) use (php 4.2.1) to
parse php tags.

I installed apache to /usr/local/apache. I installed php
--with-apache2=/usr/local/apache. Added: AddType application/x-httpd-php
.php
to httpd.conf. But I cannot load a php module, because there is no such.
It should be somewhere in apache/modules or apache/libexec...

I tried the way they recommend to compile apache+php in the php manual,
but it doesn't work as well.

Please tell me if I do something wrong.

Thanks.

 
 
 

apache+PHP problem

Post by KS » Sat, 09 Nov 2002 17:31:49



> Hao!

> I have problems making my apache (2.0.35) use (php 4.2.1) to
> parse php tags.

> I installed apache to /usr/local/apache. I installed php
> --with-apache2=/usr/local/apache. Added: AddType application/x-httpd-php
> .php
> to httpd.conf. But I cannot load a php module, because there is no such.
> It should be somewhere in apache/modules or apache/libexec...

I am using apache 1.3.26 and have compiled php4.2.1 as a dynamic
module. However, after compiling the module you have to add it in the
httpd.conf file. And it is not in apache/modules or
apache/libexec....(it looks there by default) but in
php/libs/libphp4.so
All you have to do is now to write the following line the httpd.conf
in its DSO support section and restart apache.
LoadModule php4_module                 __php/libs/libphp4.so

for __ you can use the relative(better) or abs path.

I hope this helps.

Quote:> I tried the way they recommend to compile apache+php in the php manual,
> but it doesn't work as well.

> Please tell me if I do something wrong.

> Thanks.


 
 
 

1. Apache+PHP problem (was under Linux, now under Solaris)

Hopefully you know what you are doing here in terms of letting people
execute SQL commands directly.  Be very careful with your MySQL
permission bits to avoid having someone do a 'delete from table' on you,
or even a 'drop table'!

Anyway, your problem is that on your Linux server magic_quotes_gpc is
turned off for some reason and on your Solaris server it is turned on.  
The GPC part is shorthand for GET/POST/COOKIE and the magic_quotes is the
terminology used to describe PHP's automatic quote escape mechanism.  
When magic_quotes_gpc is turned on, any single quotes that pass through
either GET, POST or COOKIE methods will be escaped with a backslash as
you have seen.  PHP is heavily used by people to build forms and insert
the text entered in these forms directly into a database.  In these cases
it it very handy to have PHP automatically escape the strings to be
inserted correctly.  It is not common to build an application that takes
raw SQL queries directly from user input.

The solution for you is to turn off magic_quotes_gpc.  You can do this in
your php3.ini file, or in your Apache httpd.conf file.  It is obvious how
to do it in the php3.ini file, but in the httpd.conf you would need to
add a line like this to do it:

php3_magic_quotes_gpc Off

if you want to set it there.

-Rasmus

2. Apache & Linux

3. Apache/PHP problems with forms

4. Socket time variables

5. apache+PHP problem

6. mailrc file

7. apache + php problem

8. help a newbie with iptables

9. DBM-APACHE-PHP problem

10. apache + php problem

11. Apache w/ PHP and SSL: w/ PHP OK - w/out PHP NOK

12. Solaris - PHP- Apache- Oracle : Problem getting PHP installed