Digital Point Forums
iKobo

Go Back   Digital Point Forums > Design & Development > Programming > PHP
Google Analytics
Log In to view
your analytics

Reply
 
Thread Tools
  #1  
Old Nov 3rd 2009, 7:22 pm
Kreshna's Avatar
Kreshna Kreshna is offline
Peon
 
Join Date: Nov 2009
Posts: 5
Kreshna is on a distinguished road
Recompiling PHP that was installed from RPM package?

I need to recompile an existing PHP installation, but the PHP was installed from RPM package.

Is it possible to recompile such RPM-installed PHP? And if that's the case, what things should I anticipate? What potential problems I'm going to face?

I'm quite familiar in compiling from scratch, but I have never re-compiled anything before. I'm also unfamiliar with RPM. Should I use the usual ./make and /make install command, or should I use RPM instead? Can RPM recompile things?
Reply With Quote
  #2  
Old Nov 3rd 2009, 7:31 pm
digitalpoint's Avatar
digitalpoint digitalpoint is offline
My cat is on Prozac... really. lol
 
Join Date: Mar 2004
Location: San Diego, California
Posts: 22,364
digitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond repute
Phone Verified
Yeah, it should be fine... When I do it, I leave the RPM installed version there and just put my compiled version in a different location. The default location for custom compiled versions is /usr/local/bin, so just make sure the RPM version isn't installed in there for some bizarre reason.
__________________
- Shawn
Keyword Tracker now supports Google (once again) as well as Bing (new) and Yahoo
Please do not PM, IM or email me for product or tool support (they will go unread/ignored), and don't "friend" me unless we are really friends.
Reply With Quote
  #3  
Old Nov 3rd 2009, 8:07 pm
Kreshna's Avatar
Kreshna Kreshna is offline
Peon
 
Join Date: Nov 2009
Posts: 5
Kreshna is on a distinguished road
Quote:
Originally Posted by digitalpoint View Post
When I do it, I leave the RPM installed version there and just put my compiled version in a different location.
Thanks for the reply. But instead of modifying the existing RPM-installed version, you just compile a new instance of PHP and put it in different location, don't you?

How to tell Apache to use the new PHP instance?
Reply With Quote
  #4  
Old Nov 3rd 2009, 8:09 pm
digitalpoint's Avatar
digitalpoint digitalpoint is offline
My cat is on Prozac... really. lol
 
Join Date: Mar 2004
Location: San Diego, California
Posts: 22,364
digitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond repute
Phone Verified
Yep... that's correct. You will need to edit your Apache config files to tell it where the new module is located (when you compile, it will tell you where it installed it to).
__________________
- Shawn
Keyword Tracker now supports Google (once again) as well as Bing (new) and Yahoo
Please do not PM, IM or email me for product or tool support (they will go unread/ignored), and don't "friend" me unless we are really friends.
Reply With Quote
  #5  
Old Nov 3rd 2009, 8:25 pm
Kreshna's Avatar
Kreshna Kreshna is offline
Peon
 
Join Date: Nov 2009
Posts: 5
Kreshna is on a distinguished road
Quote:
Originally Posted by digitalpoint View Post
Yep... that's correct. You will need to edit your Apache config files to tell it where the new module is located (when you compile, it will tell you where it installed it to).
Thanks again, and glad to know I don't have to re-compile Apache.

By the way, if the user already have existing Mambo/Joomla, this method won't distrupt the Mambo/Joomla, isn't it? Pardon the noob question but I'm unfamiliar with CMS.

The reason I need to re-compile PHP is because I'm going to install MapServer PHPMapScript API on the production web server, but the server already has a running CMS-managed website.
Reply With Quote
  #6  
Old Nov 3rd 2009, 8:26 pm
NatalicWolf NatalicWolf is offline
Hand of A'dal
 
Join Date: Dec 2007
Location: New york
Posts: 257
NatalicWolf will become famous soon enough
if you need help, pm me.
__________________
If I help you with any problems you have, please add to my reputation points...It helps me, so others know I can help them. Thank you!
*God I can't stand generic "I can do this" replies...
Reply With Quote
  #7  
Old Nov 3rd 2009, 8:33 pm
digitalpoint's Avatar
digitalpoint digitalpoint is offline
My cat is on Prozac... really. lol
 
Join Date: Mar 2004
Location: San Diego, California
Posts: 22,364
digitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond reputedigitalpoint has a reputation beyond repute
Phone Verified
The Mambo/Joomla site will be upgraded to your custom compiled version of PHP... you can't run two different versions of PHP on the same web server (well not easily anyway).
__________________
- Shawn
Keyword Tracker now supports Google (once again) as well as Bing (new) and Yahoo
Please do not PM, IM or email me for product or tool support (they will go unread/ignored), and don't "friend" me unless we are really friends.
Reply With Quote
  #8  
Old Nov 14th 2009, 5:39 am
Kreshna's Avatar
Kreshna Kreshna is offline
Peon
 
Join Date: Nov 2009
Posts: 5
Kreshna is on a distinguished road
Thanks, digitalpoint, and you too, NatalicWolf.

One last question though (I hope it will be the last):

Intuitively (I said "intuitively" because I have never tried this before), I think compiling a "new instance" of PHP is much cleaner and safer than trying to overwrite your existing PHP installation. All you need to do is to change httpd.conf, restart Apache, and voila! Apache will use the newly installed PHP, and I will not break anything.

And since this is production web server, I need to be very careful not to break anything.

However, a friend of mine said that this method will likely overwrite a shared lib somewhere, that will break.

Is that true? Considering the existing PHP doesn't even use MySQL, I guess nothing would break. What do you think?
Reply With Quote
  #9  
Old Nov 14th 2009, 6:55 am
Kreshna's Avatar
Kreshna Kreshna is offline
Peon
 
Join Date: Nov 2009
Posts: 5
Kreshna is on a distinguished road
Well of course the site uses mySQL! Judging from its appearance, it appears to use mambo or other CMS products, which naturally uses MySQL.

Furthermore, a further look on the phpinfo.php shows MySQL-related entries:
Quote:
additional .ini files parsed /etc/php.d/gd.ini, /etc/php.d/mysql.ini, /etc/php.d/mysqli.ini, /etc/php.d/pdo.ini, /etc/php.d/pdo_mysql.ini, /etc/php.d/pdo_sqlite.ini
and
Quote:
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_INCLUDE -I/usr/include/mysql
MYSQL_LIBS -L/usr/lib/mysql -lmysqlclient
Questions:

(1) How can the existing PHP connect to MySQL despite the ./ switch clearly says "--without-mysql"?

(2) If I install a "new instance" of PHP, what should I do to keep the connection to the existing MySQL, thus avoid breaking the existing website?

(3) If I overwrite the existing PHP by rebuilding the RPM, will the "newly upgraded" PHP retain its MySQL connection?

(4) Besides MySQL, what other things should I worry about? What other components usually depends on a typical PHP installation? And do those components were also installed by defaults, whether I installed a new instance of PHP or rebuilding the RPM?

Actually, what I need to do is nothing more than adding "--with-pgsql" switch on the existing PHP. I never thought it'll be that complicated.
Reply With Quote
Reply

Bookmarks

Thread Tools

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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Which PHPmyAdmin Package should be installed for localhost editing purposes + GAdsense Site & Server Administration 25 Feb 14th 2008 10:12 am
Recompiling php with gd libraly? jacobkell PHP 0 Jan 4th 2008 4:43 pm
Need a PHP/CGI script installed? (X)HTML or CSS site verified, forum mod installed++ SuperHumanly Services 9 Dec 15th 2007 4:43 pm
backup before recompiling php? malchiang PHP 3 Jul 23rd 2007 6:12 pm
i just installed php 5 apache 2.0 but the php aint working mahmoudhh PHP 5 Feb 15th 2007 7:06 pm


All times are GMT -8. The time now is 6:31 am.