Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
02-17-2011, 05:23 PM
|
#1
|
Senior Member
Registered: Dec 2004
Posts: 1,056
Rep:
|
remove old PHP on OSX 10.5.8, get new PHP all hooked in
I have managed to download and build PHP 5.3.3 from source on my 10.5.8 system, but there are still vestiges of the old version of PHP on this system -- mostly command-line stuff.
For example, on the command line, instead of just typing "php file.php", it launches an older version of php. To get my latest running, I must type the full path to my new php: "/usr/local/bin/php file.php"
I see that my path is this:
Code:
My_Mac:mbam_v4 sneakyimp$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/mysql/bin:.
And that there's a version of php living in /usr/bin:
Code:
Jason_Mac:mbam_v4 christopherwalsh$ ls -l /usr/bin/php
-r-xr-xr-x 1 root wheel 14869808 Oct 6 16:57 /usr/bin/php
Note that the item there is a full-blown file and not a symbolic link. I'd like to delete it but I'm a bit afraid to break things -- and I'm also wondering if there might be other pieces to this old PHP somewhere.
I'm wondering anyone can give me a comprehensive set of steps to get rid of all OLD versions of php and get my new one hooked in at all the right places. Any help would be much appreciated.
|
|
|
02-17-2011, 09:10 PM
|
#2
|
LQ Guru
Registered: Apr 2005
Location: /dev/null
Posts: 5,818
|
If anything, what I would do man is uninstall the new version of php, then do an updatedb, and locate php and track down everything that comes up for php. Normally when I have problems like that, that is all I do to remove everything. Maybe you could do the same, except using equivalents in OSX? Hope it helps.
Also one last thing, maybe you can download the source package to the old version of php and see if it comes with an uninstall script?
|
|
|
02-17-2011, 11:18 PM
|
#3
|
Senior Member
Registered: Dec 2004
Posts: 1,056
Original Poster
Rep:
|
corp, I really appreciate your response.
I'm not really sure *how* to uninstall either version of PHP. I compiled it from scratch by downloading the source and doing the configure/make/make install thing. AFAIK there is no 'uninstall'. The best I can do is probably to delete the source directory, any directories named 'php', and any suspect-looking items. I'm not really sure where/how to find them all. Remember that this is a Mac and there is no 'apt-get remove php' option.
And then there are things that depend on php or somehow refer to them.
Not sure what you mean by 'do an updatedb'. Also, not sure where to locate an appropriate package in this case. It's a mac and it came installed with php 4.x.
Lastly, I'd like to be able compile/recompile periodically and yet the "make install" command seems to prefer /usr/local/bin rather than /usr/bin for install location while at the same time all the distros I know use /usr/bin -- including OSX.
FYI, these are the locations of all items named "php" that seem relevant:
Code:
My_Mac:/ sneakyimp$ sudo find * -name php
Password:
Developer/SDKs/MacOSX10.4u.sdk/usr/include/php
Developer/SDKs/MacOSX10.5.sdk/usr/include/php
Users/sneakyimp/src/php-5.3.2/sapi/cli/php
Users/sneakyimp/src/php-5.3.3/sapi/cli/php
usr/bin/php
usr/include/php
usr/lib/php
usr/local/bin/php
usr/local/include/php
usr/local/lib/php
usr/local/php
|
|
|
02-18-2011, 11:44 AM
|
#4
|
LQ Guru
Registered: Apr 2005
Location: /dev/null
Posts: 5,818
|
Using that last, try to clean all that up in your system, and then go through your environmental variables and see if there are any references to PHP, and ditch them too. After that, try again man and let me know how it goes.
|
|
|
02-18-2011, 12:04 PM
|
#5
|
Senior Member
Registered: Dec 2004
Posts: 1,056
Original Poster
Rep:
|
Which environmental variables? I'm familiar with PATH but not the others.
|
|
|
02-18-2011, 12:08 PM
|
#6
|
LQ Guru
Registered: Apr 2005
Location: /dev/null
Posts: 5,818
|
Which ever ones you have on your system. I'm sorry I don't have much experience with OSX, I am not a fan of macs
|
|
|
02-18-2011, 03:37 PM
|
#7
|
Senior Member
Registered: Dec 2004
Posts: 1,056
Original Poster
Rep:
|
well OSX is basically BSD Unix. Any linux vars come to mind?
I'm about to try this....
|
|
|
02-18-2011, 04:46 PM
|
#9
|
Senior Member
Registered: Dec 2004
Posts: 1,056
Original Poster
Rep:
|
Thanks for that link. I checked all the files they refer to for setting environment vars and most don't exist on my Mac. I did enter "export" on the command line which apparently reports my environment vars -- none of which refer to php at all. I'm feeling pretty good about this. I also learned how to get PHP to install in /usr/bin/ instead of /usr/local/bin which is helpful.
Now, if only there was something like "make uninstall"....
|
|
|
02-18-2011, 04:48 PM
|
#10
|
LQ Guru
Registered: Apr 2005
Location: /dev/null
Posts: 5,818
|
That one we will have to get someone else with just a weeee bit more experience with OSX....
|
|
|
02-18-2011, 06:45 PM
|
#12
|
Senior Member
Registered: Dec 2004
Posts: 1,056
Original Poster
Rep:
|
Quote:
Originally Posted by corp769
|
I had seen that link but my computer doesn't have an /etc/httpd folder. I must have removed the old web server some time ago.
I went for it and deleted/renamed most of that old php stuff to *OLD and I recompiled php 5.3.5 with a few extra extensions (pcntl) and thanks to this thread about the configure command I was able to alter the ./configure step of compilation so that it put everything in /usr instead of /usr/local. It seems to be working great. I restarted apache and it shows 5.3.5 with all the extensions. I run from the command line (without the endless path in front) and i get 5.3.5. I'm feeling pretty good about this.
The one bizarre thing was that php complained about not finding a php.ini file -- you think it would generate one?
Anyways, it seems to be working. Thanks for the tips.
|
|
|
02-18-2011, 06:51 PM
|
#13
|
LQ Guru
Registered: Apr 2005
Location: /dev/null
Posts: 5,818
|
I would think that it would.... LOL
But awesome man, glad to help out.
|
|
|
All times are GMT -5. The time now is 02:35 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|