Upgrading PHP in slackware? Possible? how?
Hello,
I am currently using Horde Webmail (a php based groupware) at version 4.0.9. The newest version is 5.1.0 and I have been trying to upgrade for several weeks (if not months) and I cannot. Basically, according to the Horde's website instructions to upgrade from 4.x to 5.x, I should only have to run Code:
pear upgrade -a -B horde/webmail Code:
horde/webmail is already installed and is the same as the released version 4.0.9 From within the admin page of the application, I click the "Check for newer versions" button, and immediately it says A newer version (5.1.0) exists. SO I am heavily confused. I posted on the project's maillist, but did not get huge support. One of the devs suggested to upgrade php. As a matter of fact, my slackware server still runs the stock 13.1 release of Slackware. Pear Code:
PEAR Version: 1.9.4 Some of the server's info: Code:
Zend Server Community Edition Thanks! |
Hi lpallard, The 5.3.26 package is actually already built and ready for upgrade in the patches directory of the Slackware 13.1 file tree.Aside from that you should be able to upgrade php with the Slackware build script from the source directory. You may be required to upgrade some other packages based on the dependencies.
Good luck. ;-) |
Ok I went ahead and upgraded php package with the 5.3.26 from the patches folder from Slack's filetree..
immediately upon launching php to see if its all right, I get: Code:
bash-4.1# php -v Code:
./php.SlackBuild: line 73: cd: /tmp/mount/php-5.3.26/../alpine: No such file or directory |
Well, I think that the easiest solution for you now is to do a fresh 14.0 installation.
If you want to stick with 13.1 wich I don't suggest setup /etc/slackpkg/mirrors file with a 13.1 mirror then do the usual things Code:
slackpkg update |
Quote:
|
Quote:
The best I could have to rebuild the server with Slack 14 or another OS is about 2 days top... I am not so sure I can migrate the complete machine to a different OS. Hell Im not even sure I can upgrade the machine without problems. I guess for now I will wait for the next period until we dont really need the machine and wipe clean and reinstall fresh. Lots of stuff has to be upgraded at this point. Most of the front end applications are being upgraded from time to time, but the backend apps such as php or apache, mysql, etc are from Stock 13.1 and date back to 2010.. This short experience with simply upgrading php has renewed the feeling that sooner or later, I will have to migrate away from slackware, unless other distros are not offering easier management tools. I simply dont see myself sitting in front of the server for a week rebuilding and reinstalling everything from scratch or sources. Thats why I am still using 13.1. The only reason why I initially opted for Slack for this server was the fact that I was using slack on other machines and it was the distro I knew best. I need an OS that I can easily patch and upgrade without running into a dependency hell and endless manual operations.. |
Quote:
One of your issues is that you attempted a software installation of Zend with apparently a separate version of PHP which now lives on your computer in /usr/local - which is the reason why Zend reports a different PHP version. Try to keep up to date with the Slackware official packages and patches, be very,very careful when upgrading individual pieces of Slackware-provided programs, and try to use SlackBuild scripts for all the additional software you install on a production server. That will make it easier to transition to a newer Slackware release or even to a newer custom software version. Eric |
Quote:
If I had to restart fresh with slack, I'd have to be very careful with what I install.. Now I am glad you said this: Quote:
|
Quote:
Eric |
Quote:
ppr:kut, when you say that I forgot to handle .new files, I know that you are referring to the .old or .new files slackpkg creates if the config files had changed prior to upgrading the packages but I am not sure how to proceed with php in this case.. Can you explain how to proceed? Thanks! |
Plain simple, I think that I may need to upgrade or install some extensions...
Rwading the output of "php -version", I see 3 different errors: Code:
"fileinfo", "idn" & imagick" are in /usr/lib/php/extensions but php cannot initialize them.. Perhaps upgrading them? As for "xmlrpc.so", I dont know either but I belie also upgradint it could help? "Undefined symbol" almost sound to me like the current file is not compiled in accordance to what the new php expects.. EDIT: Googling a bit I have found a blog where someone suggested to comment out the relevant lines of dbase.so & mhash.so in php.ini but I am reluctant to do so because I dont know if I (or something else in the server) will need these extensions.. How do I know which extnsions to comment out? The fact that these extensions are not in the system tells me that I can safely comment out these extensions.. |
lpallard,
Check the files "/etc/httpd/php.ini-*" which will have been installed by the upgraded php package. Check your existing php.ini for any modifications you have made in the past and copy the file to another name so it will not get overwritten. Select one of the two files php.ini-development php.ini-production - whatever suits your server best, usually that will be php.ini-production, and copy it to /etc/httpd/php.ini, overwriting your original. Then merge the modifications you made to the original php.ini (you saved a copy). That will get rid of the errors. Eric |
I don't think you are skilled enough to be a system administrator of a production server. That's not the end of the world of course and that doesn't mean that you can't try. Maybe you'll find debian or ubuntu even simpler at first but in my experience that kind of systems gets really messy really soon if you don't take care and that's what happened to your slackware server that imho is less prone to this.
Again if you can move the server even temporarily and reinstall slackware to the newest stable version (and keep it update) that's is the way to go. If you don't have the hardware you can rent a server for a moth or so, to keep it blindly going is just the way to disaster. |
Quote:
Now a word of advice, I didnt take it personally because I see you are from Italy, and English *may* not be your primary language, but when you first throw a sentence like "I don't think you are skilled enough to be a system administrator of a production server." it may be taken personally and insulting to someone ;) I once said something similar on another forum trying to be polite and make a constructive remark because the person I tried to help didnt even understand the concept of package dependencies and was trying to build a multi media machine :) I was burnt alive by other members just because my remark was not well understood. Anyways, all that being said, I agree I need to sit down and rebuild this machine from scratch. Its necessary for several reasons, the machine architecture is obsolete (hardware specs), partition scheme is also not very efficient, I am using multi volume VG's to store terabytes of data, I have about 60 custom scripts running everywhere in the machine.. Its a wonder that it ran flawlessly for almost 3 years! Something to remember: when I initially purchased the parts and built this machine, I only had in mind a NFS storage to remedy for the small laptop's HDD I had at that time. From a NFS mount to Sickbeard, CouchPotato, apache, MySQL, a document management system, a groupware, etc.. it evolved into more or less a server that we rely to store our data and databases... Long story short, I will continue working on it for now and some day sooner than later I will rebuild from slack 14 or whatever will be released at that time (15 perhaps ;) |
Quote:
|
No worries.. :)
In the end you are right. I wouldnt mind to follow some kind of course or extensive tutorial to have the chance to learn how a server really work. Right now Im more or less fiddling with it, if I had to be paid to do it, it would have to be a lot more in order! ;) |
Now let me pick your brains once more... I need to get better with this php & apache stuff, damn it! ;)..
Now that my server has upgraded to the latest https & php, my sites are no longer working. Plain simple,
the list goes on and on.. At first I thought the new config files (httpd.conf & vhost-httpd.conf or php.ini) caused the problems, but looking at the httpd & vhost config files line by line, they are the same. Now php.ini has a lot of different stuff, but as AlienBob suggested here on this thread, I tried to merge the changes I had made to the old php.ini with the new php.ini file. Some logs if you guys can see the cause of my problems. I think the system is severely broken. I also remember after the package upgrades, I had these php extension errors. Trying to fix them, I have uninstalled the offending extensions, and re-downloaded/recompiled them using Code:
pecl uninstall extension Code:
pecl install extension Code:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/fileinfo.so' - /usr/lib/php/extensions/fileinfo.so: cannot open shared object file: No such file or directory in Unknown on line 0 Code:
root@lhost2:~# pecl install fileinfo php.log Code:
[25-Jun-2013 07:03:18] PHP Deprecated: Assigning the return value of new by reference is deprecated in /var/www/htdocs/knowledgetree/lib/documentmanagement/documentutil.inc.php on line 248 Code:
2013-06-24 | 19:26:57 | ERROR | 25764 | 26475 | n/a | ktdms | default | _diagnose | diagnose: '' does not have extension 'Hook.inc.php'. Code:
2013-06-25 | 06:25:43 | ERROR | 32123 | 10538197 | n/a | ktdms | sql | logQueryError | UPDATE scheduler_tasks SET run_time = '2013-06-25 07:25:40',previous_run_time = '2013-06-25 06:25:40',run_duration = '2.44' WHERE id = 8 Code:
[Tue Jun 25 06:45:27 2013] [error] [client 192.168.0.106] PHP Deprecated: Assigning the return value of new by reference is deprecated in /var/www/htdocs/knowledgetree/ktapi/KTAPISession.inc.php on line 525 |
OK I managed to install fileinfo properly (I think at least).
Because apparently Fileinfo is now integrated with php and no longer relies on pecl, I had to reinstall it manually by downloading the sources from pecl.php.net, compiling and installing it. Worked well but now php -v complains that: Code:
PHP Warning: Module 'fileinfo' already loaded in Unknown on line 0 Code:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/mhash.so' - /usr/lib/php/extensions/mhash.so: cannot open shared object file: No such file or directory in Unknown on line 0 Code:
No releases available for package "pecl.php.net/mhash" Code:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/xmlrpc.so' - /usr/lib/php/extensions/xmlrpc.so: undefined symbol: second_arg_force_ref in Unknown on line 0 And the final blow to the head. Knwoledgetree's wizard reports that: Code:
Your version of PHP must be between 5.0 and 5.2 to run optimally. Versions that are 5.3 or higher are not recommended. |
Enough is enough. I am reinstalling the system to a fresh 14 install. After almost 3 years without updating, this is what happens.
Live & learn! |
I know the feeling with those system, they are like a house of cards.
I think you will be happier with this solution and I'm glad you decided to stick with slackware. As advice I suggest you for the future to keep updated and use sbopkg for extra software. In this way you will never mess up the system and it will be easier to mantain (since doing that is not your "core business"). That said good luck for the installation and configuration of your shiny new slackware system :D |
Quote:
You are a good person, I appreciate the feedback! Im sure the new machine will be snappier and faster than before. While I am at it, let me ask about hardware: On this machine I ran mysql and several php services... Im using an old Athlon 64 X2 with just over 3GB of RAM... AFAIK, I never ran out of RAM but the system sometimes was pretty slow (updating SQL databases, doing file transfers, etc). SHould I invest a bit and upgrade the hardware or would it be useless in my case? |
You have to identify the bottleneck wich in your system is the hd imo. Thus an SSD might be the best upgrade on your system. This said there is a prominent new feature in the 3.9 kernel that we have: you can now use an ssd as cache for a rotating disk. I don't know how good this work and I suppose that manually putting all the data that you need to be fast is actually better in term of performance but I would give a try to this and if it doesn't satisfy you it should be easy do dismiss.
|
I'll post php and apache stuff here since the other thread relating to the same machine is more hardware related..
So I am trying to install the proper extensions for php. I need to ask a few questions: tidy I need this extension for Horde webmail, and I tried to install it using "pecl install tidy" unfortunately it returned: Code:
root@lhost2:~/Downloads/tidy-1.2# pecl install tidy Code:
root@lhost2:~/Downloads/tidy-1.2# phpize Again, this extension is needed for Horde, and I tried installing it with the standard method (pecl install imagick) Code:
root@lhost2:~/Downloads/tidy-1.2# pecl install imagick Code:
root@lhost2:~/Downloads/tidy-1.2# pecl install imagick Code:
if test -r $WAND_DIR/include/ImageMagick/wand/MagickWand.h; then Code:
if test -r $WAND_DIR/include/ImageMagick-6/wand/MagickWand.h; then Thats why I tried creating a symlink as I said before.. Thats a no-go too.. See next post for apache.. |
Apache misconfiguration
Simply put, I have copied my old configuration lines to the current httpd.conf, httpd-vhosts.conf, php.ini, mod_php.conf, etc (NOT the whole files since I thought there might be new options in the current config files which didnt exist back when I installed apache 3 years ago) Apache starts without errors. Note that I will be running several web applications so I will be using virtualhosts (vhosts). Code:
[Sat Jun 29 10:43:09.506727 2013] [mpm_event:notice] [pid 27147:tid 140284829337472] AH00494: SIGHUP received. Attempting to restart Code:
Internal Server Error Code:
[Sat Jun 29 10:45:45.323775 2013] [core:alert] [pid 30844:tid 140284319098624] [client 192.168.0.106:47915] /var/www/htdocs/rsslounge/.htaccess: <IfModule not allowed here My config files: httpd.conf Code:
ServerRoot "/usr" Code:
<VirtualHost *:80> Code:
[PHP] |
Please check https://httpd.apache.org/docs/2.2/mo....html#ifmodule
If you want to use IfModule in a .htaccess file you need to have defined "AllowOverride All" in your vhost configuration. You do that for some, but not for all. And it is not present in your rsslounge VirtualHost definition. Eric |
Hey Eric,
I have added the relevant line to the vhost definition. The link you sent me to (apache's website) clearly states: Quote:
The rsslounge's vhost now looks like: Code:
<VirtualHost *:80> Code:
AH00526: Syntax error on line 59 of /etc/httpd/extra/httpd-vhosts.conf: |
Some updates:
Tidy: follow the detailled instruction of user ljb643 at thread http://www.linuxquestions.org/questi...et-4175467201/ Worked flawlessly! Thanks ljb643 for your help!!! imagick: pretty much same thing as whats explained for tidy on the thread I am referring you to... downloaded imagick's source code, verified that imagick was installed (and it was), and compiled from sources with Code:
phpize Again, success and quite simple. Apache misconfig: Thanks to the folks at IRC ##httpd and #php, I realized that I didnt need virtualhosts definitions... As a matter of fact, simplifying my config quite a bit by merging the mecessary overrride options and statements from httpd-vhosts.conf to httpd.conf solved 99% of my issues.. The rest was a bit of house cleaning. Now my biggest concern and problem will be to somehow import or transfer my huge database from my previous knowledgetree install to another Document management system.. (Alfresco or drupal??). I am extremely disappointed after knowledgetree for dropping the community editions without giving users a possibility to migrate. Im sure there are other people like me who used the community edition for years and uploaded thousands of documents to their DMS. For us, what to do?? Find a cheap paid commercial alternative, restart fresh with another opensource project which might just get abandoned in a feww years, or somehow tweak things until the last KT release works with the up-to-date apache and PHP.. I guess thats a MAJOR drawback of opensource... Since there are no legal agreements between them and end users, they can just pull the plug anytime they want, without wondering how people will deal with it. |
Quote:
P.S. thanks for the thanks re: building tidy extension for PHP. |
Quote:
anyways, thats another topic... :) Long story short, I just found what they did with the community efforts and contributions cheap. Of course this is only my personal opinion.. I just felt like I helped them develop a commercial solution at my expense. Of course perhaps this was the point of the Community edition, but AFAIK nowhere it was advertised as such. Now I need to find a new DMS system and migrate my DB to it ASAP.... Anybody knows a good DMS? Alfresco?????? OpenKM????? Im all hearing ;) |
I have asked the Horde maillist for advice but havent received any responses yet. Im hitting my head on the walls so to speak to get their horde frameqwork to run on my "shiny" slack box.
According to them, my PEAR is NOT in my path (whatever that means for a noob like me). I have tried everything I could think of.. My include_path directive in php.ini has: Code:
include_path = ".:/usr/lib64/php:/usr/include/php:/usr/lib64/php/PEAR" Quote:
|
You might try this command: (1)
Code:
$ pear config-show | grep 'PEAR directory' Then try this: (2) Quote:
You want the output from (2) to include (1). On my system, (1) is /usr/lib/php and that is where PEAR lives, but I don't know if it is different on your 64-bit system. |
OK I have tried what you suggested and everything make sense.
Code:
pear config-show | grep 'PEAR directory' Code:
PEAR directory php_dir /usr/lib64/php Code:
php -r 'echo get_include_path() . PHP_EOL;' Code:
.:/usr/lib64/php:/usr/include/php:/usr/lib64/php/PEAR The guys on the Horde maillist are convinced that Slackware's pear setup is broken somehow. I am not sure what to think. I dont know enough about this stuff but I am thinking that either Slackware 14 has major php issues (and other issues I wont talk about here) or the horde devs are not taking my issue seriously enough. |
Not sure what happened exactly, but I uninstalled everything in pear (from the horde channel) unregistered the horde channel, cleared cache, and reinstalled everything.
Works fine now! Strange though, I tried on a Slack 14 VM before I succeded on my local server and it failed too. I wonder if there;s something Horde doesnt like about Slackware or vice-versa? Until next time, thanks everybody for the great help! As usual, slackware rocks! :Pengy: |
All times are GMT -5. The time now is 06:45 PM. |