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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
11-13-2003, 02:29 PM
|
#1
|
|
LQ Newbie
Registered: Nov 2003
Location: NC
Distribution: RedHat 9
Posts: 4
Rep:
|
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.
|
|
|
|
11-13-2003, 03:41 PM
|
#2
|
|
Senior Member
Registered: Apr 2003
Location: Eire
Distribution: Slackware 12.0, OpenSuse 10.3
Posts: 1,120
Rep:
|
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
|
|
|
|
11-13-2003, 03:49 PM
|
#3
|
|
Member
Registered: Jun 2002
Posts: 405
Rep:
|
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.
|
|
|
|
11-14-2003, 03:15 AM
|
#4
|
|
Member
Registered: Nov 2003
Location: Poland => Mazowieckie => Ok'a
Distribution: Gentoo
Posts: 176
Rep:
|
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.
|
|
|
|
11-14-2003, 12:51 PM
|
#5
|
|
LQ Newbie
Registered: Nov 2003
Location: NC
Distribution: RedHat 9
Posts: 4
Original Poster
Rep:
|
ok, thats kind of confusing me as I have no PHP4 in my modules directory under the apache2 directory.
|
|
|
|
11-15-2003, 03:16 AM
|
#6
|
|
Member
Registered: Nov 2003
Location: Poland => Mazowieckie => Ok'a
Distribution: Gentoo
Posts: 176
Rep:
|
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.
|
|
|
|
11-15-2003, 12:34 PM
|
#7
|
|
LQ Newbie
Registered: Nov 2003
Location: NC
Distribution: RedHat 9
Posts: 4
Original Poster
Rep:
|
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 12:42 PM.
|
|
|
|
11-16-2003, 03:57 AM
|
#8
|
|
Member
Registered: Nov 2003
Location: Poland => Mazowieckie => Ok'a
Distribution: Gentoo
Posts: 176
Rep:
|
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.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 05:02 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|