LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 05-26-2003, 05:35 AM   #1
kaustav
LQ Newbie
 
Registered: Nov 2002
Posts: 14

Rep: Reputation: 0
Configure Apache and PHP


Hi,

Where can I get detailed info regarding how to configure and use Apache along with PHP. I have Red Hat 8.0 and have installed Apache Server and PHP thats available in the packages. Also are there any GUI tools available to configure them or do I need to edit files and if so which files are those.

MySQL is already configured and I am able to use it.

Thanks.
 
Old 05-26-2003, 03:24 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
There is very little configuration needed:
http://www.php.net/manual/en/install...l.apache2.unix

Are you having a specific problem?
 
Old 05-26-2003, 03:40 PM   #3
shaggz
Member
 
Registered: Dec 2002
Location: FuNkYToWN
Distribution: SuSe, Gentoo, Fedora
Posts: 64

Rep: Reputation: 15
Depending on whether or not you used rpms for the install you can do the following.


If w/rpm's you can go to ftp.redhat.com or on your source cd's and install the rpm for mysql support within php. I believe it is on Disk 2, however I knows its on redhats FTP site as well.


If you compiled it yourself then you will need to recompile php and your apache binary. I'll leave and example below.

Hope it helps.

PHP 4.2
'./configure' '--with-config-file-path=/etc' '--with-mysql=/usr/local/mysql'
'--with-imap' \
'--with-gd' '--with-jpeg-dir=../jpeg-6b' '--with-png-dir=../libpng-1.2.3' \
'--with-zlib-dir=../zlib-1.1.4' '--with-imap=../imap-2001a'
'--with-apache=../apache_1.3.26'

PHP 4.3
./configure --with-config-file-path=/etc --with-mysql=/pathto/mysql \
--enable-ftp --enable-bcmath --disable-debug \
--with-gd --with-jpeg-dir=../jpeg-6b --with-png-dir=../libpng-1.2.3 \
--with-zlib-dir=../zlib-1.1.4 --with-imap=../imap-2001a \
--with-apache=../apache_1.3.27



There are a ton of options you can use and availble on the net.


If you use RPM based install just getting the php_mysql rpm will do all you need. Just install and restart httpd
 
Old 05-29-2003, 11:22 AM   #4
kaustav
LQ Newbie
 
Registered: Nov 2002
Posts: 14

Original Poster
Rep: Reputation: 0
Question

Hello there,

Thanks for all your inputs. I had made two php pages - namely test.php and tes1.php with the following codes -

Test.php

<?
phpinfo();
?>


Test1.php

<?php
phpinfo();
?>

I had placed them in the folder /var/www/html/

Now when i type the url http://localhost/test.php

I get a blank page and when I execute http://localhost/test1.php I get the detailed info regarding PHP. Why is this so. What other configurations do I need ? Please suggest.


Thanks.
 
Old 05-29-2003, 05:12 PM   #5
boreo
Member
 
Registered: Feb 2003
Location: Dominican Republic
Distribution: Slackware, FreeBSD, RedHat
Posts: 326

Rep: Reputation: 30
Hey david_ross I want to try SmoothWall, I have an old computer in my house with a p2 233 CPU and 2GB of HD space, Thats good to run smoothwall right?
 
Old 05-29-2003, 10:15 PM   #6
DavidPhillips
Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,154

Rep: Reputation: 56
boreo
Please don't get off subject, you should start another post or use email to direct a message to other members. Thanks


_____________________________________________________

What you are using in the first example is a short open tag, it appears that your php configuration does not allow such tags.

check your /etc/php.ini file


short_open_tag = On

Last edited by DavidPhillips; 05-29-2003 at 10:18 PM.
 
Old 05-30-2003, 01:30 AM   #7
kaustav
LQ Newbie
 
Registered: Nov 2002
Posts: 14

Original Poster
Rep: Reputation: 0
Hi there,

That worked. Thanks. Now I need to fix this issue.

I got a simple site made in PHP and MySQL and is running perfect. I have hosted it locally in Win 98 using PHPTriad. Now when I take the same to the Linux, I get the main page displayed. However when I try to login, nothing happens. I get no errors either. The login details are stored in a config.php file.

Also after a successful login, I have a script to create the tables for the application. The database has to be created beforehand or can be created through the script itself.

How do I check whether my PHP is configured for MySQL or not ?

PS. kindly note that I had installed Apache, PHP and MySQL as available in the packages from the installation disks during the setup itself. I haven't compiled them myself. MySQL is working fine, I say this because I can login to it and create databases and tables.

Thanks.
 
Old 05-30-2003, 03:17 AM   #8
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
You will also need the "php-mysql" package.
 
Old 05-30-2003, 03:27 AM   #9
kaustav
LQ Newbie
 
Registered: Nov 2002
Posts: 14

Original Poster
Rep: Reputation: 0
Hi,

Thanks again. Doesn't the PHP-MySQL package get automatically installed when I have selected all MySQL and PHP components available from the installation disks or is it separately available for download.
 
Old 05-30-2003, 04:20 AM   #10
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
Check to see if it is installed using:
rpm -qa | grep php-mysql

I would also make sure that you upgrade it if you upgraded php.
 
Old 05-31-2003, 10:46 PM   #11
kaustav
LQ Newbie
 
Registered: Nov 2002
Posts: 14

Original Poster
Rep: Reputation: 0
Hi David,

rpm -qa | grep php-mysql

returned no results. Now what do I do ?

Thanks.
 
Old 05-31-2003, 11:58 PM   #12
MasterC
Guru
 
Registered: Mar 2002
Location: Salt Lake City, UT - USA
Distribution: Gentoo ; LFS ; Kubuntu
Posts: 12,612

Rep: Reputation: 64
You locate the package on your install CD's and install it:
rpm -ivh filename.rpm

Cool
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
configure php with apache varunbihani Linux - Software 1 01-13-2005 05:43 AM
Apache + Php . I can not configure it . Help me :( kernelvn Linux - Software 3 09-17-2004 10:02 AM
Need help to configure Apache TO EXECUTE PHP SCRIPTS mgrapr Linux - Hardware 2 01-21-2004 09:23 AM
How do i configure RH-9, apache 2.0, php and mysql rolling_titan Linux - General 4 10-18-2003 06:56 AM
Configure Apache and PHP kaustav Linux - Newbie 1 05-26-2003 06:41 AM


All times are GMT -5. The time now is 10:31 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration