Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 08-25-2003, 09:04 PM   #1
LQ Newbie
Registered: Aug 2003
Posts: 24

Rep: Reputation: 15
How Apache works with PHP/MySQL/whatever...

Hi! I am kind of a newbie to Linux and I need some help understanding something.

I have an old version of PHP on my server and would like to upgrade it, but I want to make sure I know EXACTLY what I am doing before I upgrade it.

Now first of all, how do I determine how my version of PHP was complied with Apache (like if it's Static Mod or Dynamic Mod?) And second, what is the difference? I have done a lot of research online to find out, and it seems to me that the main difference between static and dynamic is that with a static mod, PHP is dependant on Apache so that if Apache is restarted, PHP also is restarted whereas this is not the case if it were dynamic.

I have changed a line of code in my php.ini file and restarted apache and the change did NOT take place which makes me think that my PHP is a dynamic mod. Is it easy to make it a static mod when I upgrade?

OK. Now the upgrade question: How do I do it? I have found TONS of PHP installation tutorials, but none really cover UPGRADING. So, after putting little bits and pieces together here is what I have come up with. When I DELETE the PHP directory off of my server, PHP will still be running... then I install the NEW version of PHP and ?restart something? and then the NEW version will come up. So it's like, you can delete PHP or MySQL or whatever, and it will keep running until you restart it, right?

I just need to know if I am about to crash my server or if my research has paid off. Sorry of the length of the message, and thanks in advanced to anyone willing to help out.
Old 08-26-2003, 09:08 AM   #2
LQ Newbie
Registered: Aug 2003
Posts: 24

Original Poster
Rep: Reputation: 15
Old 08-29-2003, 12:23 AM   #3
LQ Newbie
Registered: Aug 2003
Posts: 24

Original Poster
Rep: Reputation: 15
OK, so NO ONE helped me on this, so I had to figure crap out on my own. SO! The good news is that I successfully upgraded PHP. Now, I am a firm believer in the way forums work, so just in case someone has the same situation as me, here is what I did:

I figured out the my version of PHP was in fact dynamic, but not for the reasons listed above. If you make a file and do a <?php phpinfo() ?> you can see how PHP was configured. If you see --with-apxs anywhere, then your PHP is dynamic. apxs is an apache program that lets you add modules.

Now, if you see --with-apache, then PHP is static.

I DID NOT uninstall/delete anything during the upgrade process. If your PHP is dynamic, it's a little easier to upgrade in that there are fewer steps. Here is what I did:

Download the newest TARBALL from Untar it to /usr/local/src/ (I made the src directory and that's were I will put all my original sources.)

cd /usr/local/src/


tar xvfz php-4.x.x.tar.gz
Then go into the source directory it just made, configure, make the binaries, and install it:

cd php-4.x.x/

./configure --with-apxs=/usr/local/apachessl/bin/apxs --with-mysql --enable-trans-sid --enable-debug=no --enable-track-vars --with-gd --with-ttf --with-freetype-dir --enable-gd-native-ttf --with-zlib-dir


make install
I backed up my old php.ini file and put the php.ini-dist file in it's place:

cd /usr/local/lib

cp php.ini /root/php.ini.BAK

cd /usr/local/src/php-4.x.x

cp php.ini-dist /usr/local/lib/php.ini
That's it! If you have a static module, I know you have to recompile apache, but I haven't done it before, so I don't want to tell someone something that crashes their server. Sorry.


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
Apache PHP Postgres works but not together... PeO Linux - Software 1 10-12-2005 09:01 AM
php/apache/mysql.... montassarjdidi Programming 6 04-22-2005 09:08 AM
apache , php , mysql linuxtm2005 Red Hat 1 12-29-2003 01:07 PM
Apache Mysql Php: mysql with php doesn't work breakerfall Linux - Networking 6 12-27-2003 09:59 PM
php-nuke with apache php mysql c0c0deuz Linux - Software 0 03-30-2003 07:23 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:36 PM.

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