arn_php Posted January 28, 2008 Share Posted January 28, 2008 Please help any body. How do I upgrade my server from PHP4.4.7 to PHP4.4.8. I actually have uploaded the file I dowloaded from http://www.php.net/downloads.php#v4 (I click on this one PHP 4.4.8 (tar.gz) [5,498Kb] - 03 January 2008) into this folder: /tmp/funk from within my server. I have already gunzip and untar it and it is ready for installation. But honestly I do not know what next? What do I need to do, what is the next command I have to put through the Shell (SSH). Please help.. is there any upgrade version instead of a full installation? Also shall I remove the 4.4.7 first or shall I just able to install the new one directly? My server is running on FreeBSD 4.7 with Apache/1.3.39 Ben-SSL/1.57 (Unix) PHP/4.4.7 with Suhosin-Patch mod_perl/1.30 FrontPage/5.0.2.2624 Anyone can help me go through this? I do got some help from here: http://www.php.net/manual/en/install.unix.php, but honestly I got more confuse (I am still a novice here) Please help anyone. Thanks Arnold Quote Link to comment Share on other sites More sharing options...
trq Posted January 28, 2008 Share Posted January 28, 2008 Firstly, unless you have specific reasoning for not upgrading to version 5, I would do that. php 4 has come to the end of its lifespan. If your building from source, the process is simple. Enter the source directory, call the configure script and pass it any options your require, make your configure build then compile and install. ./configure --help make && make install Quote Link to comment Share on other sites More sharing options...
arn_php Posted January 28, 2008 Author Share Posted January 28, 2008 Well, I have tried it actually but then the website I have built in PHP4 won't run properly into the PHP5 environment server. It wouldn't read the config file of the script I have. Do you know how to adjust it easily in this case? (if you do, please let know) Anyway, I actually have typed ./configure --help, but then I felt blank as I do no understand what I have to configure... Well of course I want to set it to work with mysql and within my server (with the server's configuration I mentioned below). Sorry, but after ./configure --help then this one? ./configure --prefix=/www --enable-module=so then your next command? make && make install Or shall it be.. make then.. make install Sorry about this as you might need to guide me one step after step. Will it be alright to to just 'overlap' the php4.4.7 I have already? When I type the command make install, will it take care everything else? Shall I add these lines into my httpd.conf after the installation? LoadModule php4_module libexec/libphp4.so then AddType application/x-httpd-php .php .phtml AddType application/x-httpd-php-source .phps Thanks thorpe Quote Link to comment Share on other sites More sharing options...
trq Posted January 28, 2008 Share Posted January 28, 2008 Yes it is fine to overlap the old php with the new. The easiest way to get a configure line would be to copy the one from your working install. Make a php file with the following... <?php phpinfo(); ?> in it. Browse to this file and look for the ./configure line. You can then copy this line into the term and use it as your ./configure options for your new install. As for bringing your code up to date (to work with php5) there is a section in the manual here that should get you started. Quote Link to comment Share on other sites More sharing options...
arn_php Posted January 28, 2008 Author Share Posted January 28, 2008 Thanks man. I did as you mentioned and it shows no change even after I restarted the apache (server). I check the php info and it still shows as PHP4.4.7 and not PHP4.4.8. Into the httpd.conf, after LoadModule php4_module libexec/mod_php4.4.7.so LoadModule php4_module libexec/mod_php4.so I added this line LoadModule php4_module libexec/mod_php4.4.8.so (or shall it be LoadModule php4_module modules/mod_php4.4.8.so ?) I tried to check where is the module but could not find the path. Also another weird thing, when I did ./configure, it mentioned that the registers_global is OFF - then I do the installation (make && make install). I added the line above into httpd.conf. Restart the apache, then I took a look at my php info. No changes of the verison and the registers_global stays ON. Seems like the installation that I just did, did nothing at all. What is wrong? Thanks. Quote Link to comment Share on other sites More sharing options...
trq Posted January 28, 2008 Share Posted January 28, 2008 Can I see the contents of your apache modules directory? Usually /usr/lib/apache ls -al /usr/lib/apache Quote Link to comment Share on other sites More sharing options...
arn_php Posted January 28, 2008 Author Share Posted January 28, 2008 I can tell you but not through here. How? Ok, I went into : /usr/local/apache/libexec and find : libphp4.so is a link & NO mod_php4-4.4.8.so. Only mod_php4-4.4.7.so. What do I need to do? Quote Link to comment Share on other sites More sharing options...
trq Posted January 28, 2008 Share Posted January 28, 2008 What does libphp4.so link too? Quote Link to comment Share on other sites More sharing options...
arn_php Posted January 28, 2008 Author Share Posted January 28, 2008 I do not know, it seems it was the file that being installed by me actually. And I tried to go to its destination as it mentioned as a 'link', but then the file was trying to be downloaded into my hardrive so I cancelled it. By the way, it said only 17kb, but then when it is downlaoded, it is actually a 2mb more file. is it the PHP4.4.8 file? what we need to do? shall it rename it? what is the command to do so? Quote Link to comment Share on other sites More sharing options...
arn_php Posted January 28, 2008 Author Share Posted January 28, 2008 ---------- Ok, it seems like it is a link to: /tmp/funk/php-4.4.8/.libs/libphp4.so which is a 2.84mb file. Quote Link to comment Share on other sites More sharing options...
trq Posted January 28, 2008 Share Posted January 28, 2008 Can I see the line you used for ./configure? Your install does seem a little messed up. are you sure you ran the make install step? Does freeBSD not have a package manager that can do this all for you? Sorry, I'm a linux user. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted January 28, 2008 Share Posted January 28, 2008 You are going through a lot of work to upgrade to a dead end version. Assuming your site works on php4.4.7, you should be putting your effort into testing your code under the latest version of php5. There are very few incompatible differences between php4 and php5. Almost all code that works under php4 will work under php5 (for the same php configuration.) Most of the incompatible differences are class/OOP related (thorpe provided a link above), which won't be a problem with most code. The rest of the problems are php configuration differences and code that still relies on depreciated and insecure things like register globals. Quote Link to comment Share on other sites More sharing options...
arn_php Posted January 28, 2008 Author Share Posted January 28, 2008 ./configure --with-apxs=/usr/local/apache/bin/apxs --enable-memory-limit --disable-all --enable-zend-multibyte --with-regex=system --with-openssl --with-zlib=/usr --with-zlib-dir=/usr --disable-cli --disable-cgi That is what I get from my php.ini By the way, my tech only provides support for 4.4.7 and not (yet) for 4.4.8. Shall I redo the installation? Thanks for PFMaBiSmAd suggestion. I really wish I had more knowledge in doing this. I had no school or class education on php and only tutor myself so far. Read books and documentation doesn't help me much as I got more confuse with the language. not really a smart guy after all, feeling pretty dumb right now.. I can show you a config.php file that won't be read into PHP5 if you want, maybe you can show me something there. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted January 28, 2008 Share Posted January 28, 2008 Yes, if you want help with specific things that would cause code to not work in any configuration/version of php, start a new thread in the php help forum section and post your code. Quote Link to comment Share on other sites More sharing options...
arn_php Posted January 28, 2008 Author Share Posted January 28, 2008 Seems like thorpe is not there anymore. PFMaBiSmAd, can you answer his request for me? Quote Link to comment Share on other sites More sharing options...
arn_php Posted January 29, 2008 Author Share Posted January 29, 2008 To Thorpe: Beside the ./configure you asked, this is what I just did: I went into the httpd.conf, then remove this line: LoadModule php4_module libexec/mod_php4.4.8.so (the one I added manually before) Then I went to /tmp/funk/php-4.4.8/libs to copy libphp4.so into /usr/local/apache/libexec. Because I think the file I have got there is only a shortcut/link (I actually rename it to libphp4_cad.so). Then I restart_apache and this is the message I got : [Mon Jan 28 20:35:17 2008] [warn] module php4_module is already loaded, skipping. Why is that? Is that could be an issue of my I do not get any php4.4.8 installed correctly? Also into http://www.php.net/manual/en/install.unix.php there is a line that tells: 15. And in the AddModule section of httpd.conf, somewhere under the ClearModuleList, add this: For PHP 4: AddModule mod_php4.c Where is the AddModule section on httpd.conf? I can't find it anywhere. Is this the one I missed too? Thanks Quote Link to comment Share on other sites More sharing options...
arn_php Posted January 29, 2008 Author Share Posted January 29, 2008 Thorpe, I just did this: I copied the libphp4.so into the /usr/local/apache/libexec directory from the source directory: /tmp/funk/php-4.4.8/libs. I deleted the line in the apache config file for LoadModule php4_module libexec/mod_php4.4.8.so. Well, I am unable to locate any file named mod_php4.4.8.so. I only left this 2 lines there: LoadModule php4_module libexec/mod_php4-4.4.7.so LoadModule php4_module libexec/libphp4.so Finally with regards to the reference in the installation manual (php.net) about AddModule mod_php4.c, I reviewed my apache config file and I am not able to locate either section that the instructions refer to either. I restarted the apache and eventhough it restarted succesfully, there is an error message: [warn] module php4_module is already loaded, skipping. Why is that? Is that could be an issue of my I do not get any php4.4.8 installed correctly? So shall I re-do the installation? How about my ./configure? Thanks. Quote Link to comment Share on other sites More sharing options...
trq Posted January 29, 2008 Share Posted January 29, 2008 Sorry, forgot about this thread. Your whole install looks a little messed up. Does freeBSD not have a package manager you can use? Did you install php4.4.7 from source? Quote Link to comment Share on other sites More sharing options...
arn_php Posted January 29, 2008 Author Share Posted January 29, 2008 I know (about the mess). For 4.4.8 they do not provide either a package manager or support. Only 4.4.7, that's I came here. I install 4.4.8 after downloaded it from php.net, then uploaded to my server. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted January 29, 2008 Share Posted January 29, 2008 Are you trying to install php4.4.8 because your code is affected by one of the bugs that were fixed after php4.4.7 or are you just installing this because you want to? If your code is not affected by anything that was fixed in php4.4.8, then I will say it again, you are going to a lot of work that won't produce any results. Support for php4 has ended. Except for security patches no new versions of php4 will be released. Php4.4.8 was just all the bugs that had already been fixed and it was released so that those fixes would be made public so that work could stop on php4. Everyone should be spending their time making sure that their code is not dependent on any depreciated or insecure features of php or any features that have been completely eliminated in php6 (so that you don't need to keep fixing your code.) Quote Link to comment Share on other sites More sharing options...
trq Posted January 29, 2008 Share Posted January 29, 2008 I know (about the mess). For 4.4.8 they do not provide either a package manager or support. Only 4.4.7, that's I came here. I install 4.4.8 after downloaded it from php.net, then uploaded to my server. Did you install 4.4.7 via the package magager? If so I would suggest removing it using the same package manager. You may then find that php5 is available through the package management software also. I would attempt to install that. Quote Link to comment Share on other sites More sharing options...
PFMaBiSmAd Posted January 29, 2008 Share Posted January 29, 2008 The freebsd ports page has php4.4.8 and php5.2.5 - http://www.freebsd.org/ports/lang.html Quote Link to comment Share on other sites More sharing options...
arn_php Posted February 1, 2008 Author Share Posted February 1, 2008 I actually got the application (4.4. from a mirror site of php.net. So I did not use my server's package manager as 4.4.8 is not supported. For the FreeBSD ports you mentioned, what does it do? Is it functioning as the one from php.net? Quote Link to comment Share on other sites More sharing options...
arn_php Posted February 1, 2008 Author Share Posted February 1, 2008 To Thorpe. thanks I got it to work on PHP4.4.8. What I did is commented out the php4.4.7 line into the apache config file. And it works! Super! Thanks Thorpe. Arnold Quote Link to comment Share on other sites More sharing options...
trq Posted February 1, 2008 Share Posted February 1, 2008 For the FreeBSD ports you mentioned, what does it do? It is freeBSD's package management system. You ought use it to install any software on the system. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.