Click to See Complete Forum and Search --> : apache + php and it's urgent


Anon
05-20-2002, 05:16 AM
I've installed redhat7.1 and the packages of php and apache.
When I start httpd and put my php pages in /var/www/html, the source of my page.php appears in the browser!! I don't understand why it doesn't work.
I vrfiy in the httpd.conf that the mod_php4.so is loaded.

If someone can help me, please mail me !!!!

Anon
05-20-2002, 02:35 PM
PHP isn't processing the scipt. This is because Apache isn't conifigured correctly.
Make sure that you configured Apache with php before you compiled it. Also, make sure that your http.conf contains something like the following:


<IfModule mod_dir.c>
DirectoryIndex index.html index.htm index.php default.html
</IfModule>

AddType application/x-tar .tgz
AddType application/x-httpd-php .php

Anon
05-23-2002, 06:47 AM
This is the procedure that i have done in my machine. I hope you have time to reconfigure everything...Let me know if you done it..

1. Install REDHAT 7.2

2. MYSQL-3.23.38

./configure –prefix=/usr/local/mysql
make
make install
cd scripts
./mysql_install_db
cd /usr/local/mysql/bin
./safe_mysqld & then hit enter
./mysqladmin –u root password (any password)
./mysql –u root –p
enter password
type SHOW DATABASES;

3. APACHE 2.0.35

CC=”gcc” \
./configure –prefix=/usr/local/apache \
--enable-rewrite=shared \
--enable-speling=shared \
--enable-module=so \
--enable-module=cgi

make
make install
cd /usr/local/apache/htdocs
vi phpinfo.php

<?
phpinfo ();
?>

then save…

http://localhost/phpinfo.php

configure httpd.conf and add a line like this to where you would normally add the AddType line.

<Files *.php>
SetOuputFilter PHP
SetInputFilter PHP
</Files>

<FilesMatch "\php?|phtml)$">
SetOuputFilter PHP
SetInputFilter PHP
</FilesMatch>

<FilesMatch ".php(.+)?$">
SetOuputFilter php
SetInputFilter php
</FilesMatch>

AddType application/x-tar.gz
AddType application/x-httpd-php .php


Add this to the DirectoryIndex

index.html index.php

3. PHP 4.2.1

./configure \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql=/usr/local/mysql \
--enable-track-vars \
--enable-versioning \
--with-xml
--with-dom \
--with-zlib-dir=/usr/include

make
make install

cp php.ini-dist /usr/local/php.ini