LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 11-13-2003, 03:29 PM   #1
Jeniva
LQ Newbie
 
Registered: Nov 2003
Location: NC
Distribution: RedHat 9
Posts: 4

Rep: Reputation: 0
Problem with PHP 4.3.4 and Apache2


Hello everyone,
First off, I wanted to say Great Forums!!! I have had many of my questions answered here.

Im a total n00b to linux, and im having a problem. I use RH9.

I downloaded/compiled(make)/and installed(make install) apache2 with no issues. (xxxx://24.167.164.149)
I then downloaded PHP-4.3.4, compiled/and installed it. I used the
./configure --with-mysql --with-apxs2=/usr/local/apache/bin/apxs command, and it went off with zero errors.

I added the "AddType application/x-httpd-php .php" (minus the "") to the httpd.conf line

and copied my php.ini to the /usr/local/lib/php.ini Directory

When I go to view my phpinfo.php, it wants me to download it. (24.167.164.149/phpinfo.php)

I made another .php file called test.php (24.167.164.149/test.php) and it shows up as a regular html file.

Anyone have any ideas??

I've been using linux for about 5 days now....so im really lost.
 
Old 11-13-2003, 04:41 PM   #2
Looking_Lost
Senior Member
 
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120

Rep: Reputation: 45
Do you have a line like

LoadModule php4_module modules/libphp4.so

in httpd.conf

Althjoug php added it automatically for me as far as I remember
 
Old 11-13-2003, 04:49 PM   #3
rioguia
Member
 
Registered: Jun 2002
Posts: 411

Rep: Reputation: 30
i'm struggling too but here are some suggestions for you to consider. i've been using step-by-step how-to's and most of these suggestions come from them? many of the answeres to these questions are probably recorded on your infophp.php file <?php
phpinfo();
?>

1. do you have a line in your httpd.conf like this?
LoadModule php4_module modules/libphp4.so

2. how are you loading your modules? For example --enable-dav option will build and include mod_dav and --enable-so will enable DSO (Dynamic Shared Object) support.

3. Did you modify your DirectoryIndex from

DirectoryIndex index.html

to

DirectoryIndex index.html index.php index.php4 default.htm

4. what are your permissions setting on your appache root document directory and your phpinfo.php file? for testing purposes you could just chmod -R 777 the whole root directory (this would be really bad in other than a test environment) if you want to eliminate this consideration in a hurry.

i hope this helps. i'll post back if i get my php-nuke online.
 
Old 11-14-2003, 04:15 AM   #4
jogurt666
Member
 
Registered: Nov 2003
Location: Poland => Mazowieckie => Ok'a
Distribution: Gentoo
Posts: 176

Rep: Reputation: 30
and what httpd do you use? i guess apache. if that is so

$ /configure --with-mysql--with-apache=../apache/source/dir --with-apxs2=/usr/local/apache/bin/apxs
$make
#make install

that will instal several fies in apache source code directory. than cd to apache source code directory and type:

$ ./configure --activate-module=src/modules/php4/libphp4.a
$make
#make install

after that you should add AddType (just as you did before) to httpd.conf, and start apache. everything should work fine now.
 
Old 11-14-2003, 01:51 PM   #5
Jeniva
LQ Newbie
 
Registered: Nov 2003
Location: NC
Distribution: RedHat 9
Posts: 4

Original Poster
Rep: Reputation: 0
ok, thats kind of confusing me as I have no PHP4 in my modules directory under the apache2 directory.
 
Old 11-15-2003, 04:16 AM   #6
jogurt666
Member
 
Registered: Nov 2003
Location: Poland => Mazowieckie => Ok'a
Distribution: Gentoo
Posts: 176

Rep: Reputation: 30
well that is because you haven't compiled your apache to work with php. lets say that you have sources of both apache and php in the root directory. paths to them would be:

/root/php-4.3.4
/root/apache-1.3.28

you now have to cd into apache directory, and ./configure it. when you are done, you enter php directory and do the following things lets say that you have mysql under /usr/local/mysql:

$./configure --with-mysql=/usr/local/mysql --with-apache=../apache-1.3.28 --enable-track-vars

it is important to note that you give path to apache source not already installed apache!

$make
#make install

that installs php modules in /root/apache-1.3.28/src/modules/php4 and other required stuff, but lets focus on those modules installed in apache source dir. now all you have to do is to configure apache to use php4 module to do so, cd to apache source directory and configure it with the following option:

$./configure --activate-module=src/modules/php4/libphp4.a

where src/modules/php4 is source where all php modules are kept. now one more very important thing that confused me and many other people as i have found out. namely there is no libphp4.a file! it will be created during the compilation, so don't worry. and do not give path to libmodphp4.a instead! that will cause an error! after you just type:

$make
#make install

now just modify httpd.conf. don't forget to set register_globals = On in php.ini since it is disabled by default.
well i my case it works perfectly. i hope it will also do in yours.
 
Old 11-15-2003, 01:34 PM   #7
Jeniva
LQ Newbie
 
Registered: Nov 2003
Location: NC
Distribution: RedHat 9
Posts: 4

Original Poster
Rep: Reputation: 0
k, i tried that

everything went fine until I got to the ./configure --activate-module=src/modules/php4/libphp4.a

I recieved this error:
Configure: Error: unrecognized option: --activate-module=src/modules/php4/libphp4.a


[EDIT: Even though I recieved that error, I can now view my phpinfo.php, so I guess its working, thanks!!!!!]

Last edited by Jeniva; 11-15-2003 at 01:42 PM.
 
Old 11-16-2003, 04:57 AM   #8
jogurt666
Member
 
Registered: Nov 2003
Location: Poland => Mazowieckie => Ok'a
Distribution: Gentoo
Posts: 176

Rep: Reputation: 30
hmm well you shouldn't receive any errors. if you are afraid that those errors may disturb your further work, maybe download the following compilers: ANSI C, Bison, Gawk and Flex, and try compiling php and apache once again. php uses those compilers so that may override those errors.
 
  


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
Apache2.0.52, t1lib-5.0.2, php-apache2-5.0.2 wizard7423 Slackware 2 04-04-2011 09:09 PM
Mandrake 10.1 Apache2 with PHp and pear problem Jediman Linux - Software 10 04-19-2005 04:35 PM
Apache2, PHP and Gallery problem itamarl Linux - Software 6 04-05-2005 02:36 AM
php5 apache2 mysql4 don't work, php does not seem to read php.ini atom Linux - Software 5 03-24-2005 12:05 PM
whats the problem with rh8 and apache2/php? bigswifty75 Linux - Newbie 8 07-03-2003 04:47 AM


All times are GMT -5. The time now is 09:15 AM.

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