LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-16-2006, 04:30 AM   #1
tsaravan
Member
 
Registered: Jun 2005
Location: India
Posts: 101

Rep: Reputation: 15
apache php and mysql installation


Hi,

I have installed redhat 9 and latest version as follows:

1) Apache 2.2.0 (./configure --prefix=/www --enable-module=so, make, make install)
2) mysql 5.0.18 (rpm installation)
3) php 5.1.1 ./configure --with-mysql
--with-gd=/home/tsaravan/gd-1.8.4 --with-jpeg=/home/tsaravan/jpeg-6b
--with-apxs2=/www/bin/apxs, make, make install)

Now I am not able to run php files. When I enter url with eg., index.php, I get pop-up message to save php file instead running. Also I am not able to run any photo Gallery.

Please let me know if I have made mistake in installation.
regards,

T. Saravana
 
Old 01-16-2006, 04:53 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,840

Rep: Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868
You should add the following in your httpd.conf:
Code:
AddType application/x-httpd-php .php
 
Old 01-16-2006, 05:31 AM   #3
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
There is a good guide for installing AMP from source at hostlibrary.com. It also has good tips on configuring them once their installed.
 
Old 01-16-2006, 07:05 AM   #4
tsaravan
Member
 
Registered: Jun 2005
Location: India
Posts: 101

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory
You should add the following in your httpd.conf:
Code:
AddType application/x-httpd-php .php

The said syntax is already added in the httpd.conf and still not working. Also if i make some mistake in the syntax eg. AddTyp applican/x-http-php the apache is not prompting for an error.

Please let me if there is any problem in install apache with --enable-module=so.
 
Old 01-16-2006, 07:47 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,840

Rep: Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868
Check if you have also
Code:
LoadModule php5_module  modules/libphp5.so
in your httpd.conf
To check the syntax run:
Code:
/www/bin/httpd -t
 
Old 01-17-2006, 12:36 AM   #6
tsaravan
Member
 
Registered: Jun 2005
Location: India
Posts: 101

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory
Check if you have also
Code:
LoadModule php5_module  modules/libphp5.so
in your httpd.conf
To check the syntax run:
Code:
/www/bin/httpd -t
the syntax already there. Also when i run httpd -t i get syntax ok.
 
Old 01-17-2006, 02:10 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,840

Rep: Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868
Quote:
1) Apache 2.2.0 (./configure --prefix=/www --enable-module=so, make, make install)
Now I saw it. For apache 2.x you must use "--enable-so" not "--enable-module=so". So re-compile apache using the correct option and you'll be OK.
 
Old 01-18-2006, 07:47 AM   #8
tsaravan
Member
 
Registered: Jun 2005
Location: India
Posts: 101

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by bathory
Now I saw it. For apache 2.x you must use "--enable-so" not "--enable-module=so". So re-compile apache using the correct option and you'll be OK.

Thank you I did that and now apache is working. But unfortunately apache is not parsing php files instead it shows only code of the file.

I did as follows:

1) Server installation of RedHat9
2) Apache2.2.0 (compiled and installed) - ./configure --prefix=usr/local/apache2 --enable-mods-shared=most --enable-so
3) php5.1.1 (compiled and installed) - ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-gd=/home/tsaravan/gd-2.0.33 --with-jpeg=/home/tsaravan/jpeg-6b
4) mysql 5.0.18 (compiled and installed)- ./configure --prefix=/usr/local/mysql --localstatedir=/usr/local/mysql/data -disable-maintainer-mode --with-mysqld-user=mysql --enable-large-files-without-debug.

Please help me the exact way of installation with GD support as I want to use image gallery software.

thanx in advance.

regards,

T. Saravana
 
Old 01-18-2006, 08:07 AM   #9
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Look for the section called DirectoryIndex in your httpd.conf and add index.php to the same line as index.html.
 
Old 01-18-2006, 08:35 AM   #10
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 12,840

Rep: Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868Reputation: 1868
If it shows the php code then you miss the
Code:
AddType application/x-httpd-php .php
in your httpd.conf.
To add gd support in php just compile php, using the following ./configure options:
Code:
--with-gd --with-zlib --with-png --with-jpeg
Mind that the directory where you have installed those libraries must be in /etc/ld.so.conf, or define it using LD_LIBRARY_PATH before running ./configure.
Code:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/libs
You must use the directory where the libs are installed, not the directory where you've extracted the sources (i.e. your homedir).
 
Old 10-21-2006, 02:42 AM   #11
sohailark
LQ Newbie
 
Registered: Feb 2006
Posts: 10

Rep: Reputation: 0
apache error

dear brother

i m using fc3 and want to configure apache. but when i restart apachectl it is giving me an error.


httpd: Syntax error on line 53 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: undefined symbol: php_escape_html_entities

can some one help me....
 
Old 10-21-2006, 03:11 AM   #12
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Quote:
Originally Posted by sohailark
dear brother

i m using fc3 and want to configure apache. but when i restart apachectl it is giving me an error.


httpd: Syntax error on line 53 of /usr/local/apache2/conf/httpd.conf: Cannot load /usr/local/apache2/modules/libphp5.so into server: /usr/local/apache2/modules/libphp5.so: undefined symbol: php_escape_html_entities

can some one help me....
Can you please refrain from posting the same question in multiple threads. It makes it difficult for others to follow the discussion and help you out. Cheers.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to change from the default php/apache/mysql installation in RH9? dealex Red Hat 3 01-12-2006 02:17 AM
Integrating PHP and MySQL Into Apache From Full Installation tsuehpsyde Fedora 11 05-05-2004 02:15 PM
Apache PHP MySQL Setup after Slackware 9.0 Installation initself Slackware 37 12-20-2003 06:48 AM
Order of installation Apache, Mysql, PHP,SSH piratebiter Linux - Newbie 3 08-16-2003 02:13 PM
Installation Tutorial Apache 2, PHP 4, MySQL 3.23 freddymio Programming 2 07-03-2002 09:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration