Jump to content
Compatible Support Forums
Sign in to follow this  
Thunderhawk

PHP4?

Recommended Posts

Does PHP4 come pre installed on the Apache server? Right now I am on Fedora Core, and created a directory callled /www where apache will read all my scripts and stuff from. I have created several basic PHP scripts to test it out and make sure it wasn't just hidden from me. If some one could tell me where I can download PHP4 if Fedora doesn't come with it, that would be great (I haven't been able to find a place where I could download it). If it is installed already, it isn't working and I will need some help as to how to get it going.

 

Additionally, Up2Date isn't working right now on my machine, so I don't have any recent updates from about a week or two (or three) ago. I am working on trying to fix it though...

 

Thanks smile

Share this post


Link to post

Sorry, I know just about nothing about Fedora or Linux in general

 

Judging by what it says on the sidebar, those aren't pre-compiled. How would I compile the source codes.

 

Edit: I found PHP on my Linux computer already, but it isn't installed/working on the Apache server. If you could just tell me where to put all the files and everything, that would be great. laugh

Share this post


Link to post
Quote:
Does PHP4 come pre installed on the Apache server?


No. Apache is separate from PHP. If these weren't installed on your system
during the install process then you will have to download a precompiled binary
or compile each (apache & PHP) from their sources. Most of the time these
are rpms (Red hat Package Manager) that are installed during the install process. To check is these were installed as rpms you can use these two commands:

rpm -qa php
rpm -qa httpd <-- I believe this is the apache rpm name ??

Apache and PHP are separate entities. They work together but you have to
configure each to work with the other. These don't come together.



Quote:
If it is installed already, it isn't working and I will need some help as to how to get it going.


This is a tall order. You can easily find the answers to these questions by reading the apache installation manual here:

http://httpd.apache.org/docs-2.0/

and the php installation manual here:

http://www.php.net/docs.php

If you found it difficult to find these you weren't looking very hard! You simply read the manual and it will explain how to compile and configure them.

here is how I configured my PHP:

[root@Dragon root] cd /usr/local/src/php
[root@Dragon root] ./configure --libdir=/usr/lib --with--apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-gd --with-zlib --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-tiff-dir=/usr/lib --with-bz2=/usr/lib --with-config-file-path=/etc/php.d --enable-calendar --with-openssl --with-curl --with-dom --enable-ftp --enable-inline-optimization --enable-force-cgi-redirect --enable-pic -with-pear=/usr/share/pear --enable-bcmath --enable-mcal --with-exif

then:

[root@Dragon root]make
[root@Dragon root]make install

You will need to go into the php.ini file and modify it some. You will also need to go into the apache config file httpd.conf and tell it how
to interpret dot php extensions by telling it where your php module is. Like I said all this is in the manual. That is how I figured it all out.

oh I just reread your latest post:

Quote:
Edit: I found PHP on my Linux computer already, but it isn't installed/working on the Apache server. If you could just tell me where to put all the files and everything, that would be great.


If php isn't working with Apache and you KNOW it is installed on your box then you need to go into the apache configuration file and edit it to tell it were to find your php module that you compiled. If you don't know where it is then just type:

find / -name libphp4.so (this is assuming you have php 4 installed)

If I type this I get the following:

/usr/lib/httpd/modules/libphp4.so

This is the shared loadable module that apache will load to handle any php scripts. You need to tell apache where this file is so that it can load it.
The relevant section of my httpd.conf that I need to change was:

Code:
## Dynamic Shared Object (DSO) Support## To be able to use the functionality of a module which was built as a DSO you# have to place corresponding `LoadModule' lines at this location so the# directives contained in it are actually available _before_ they are used.# Statically compiled modules (those listed by `httpd -l') do not need# to be loaded here.## Example:# LoadModule foo_module modules/mod_foo.soLoadModule php4_module        modules/libphp4.so#


See the line that starts with LoadModule? You will manually have to add that line to your apache configure file (httpd.conf) so that it knows where to find your libphp4.so file. You will also have to tell apache what extensions you want interpreted as PHP. See the relevant httpd.conf snippet below:

Code:
## Filters allow you to process content before it is sent to the client.## To parse .shtml files for server-side includes (SSI):# (You will also need to add "Includes" to the "Options" directive.)#AddType text/html .shtmlAddType application/x-httpd-php .php#AddOutputFilter INCLUDES .shtml


See the line that starts with AddType? That is the line that tells apache what kind of files it will interpret as PHP. There is more but you need to read the manual and if you still can't figure it out come back and ask.

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×