LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-17-2011, 04:23 PM   #1
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,056

Rep: Reputation: 78
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.
 
Old 02-17-2011, 08:10 PM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
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?
 
Old 02-17-2011, 10:18 PM   #3
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,056

Original Poster
Rep: Reputation: 78
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
 
Old 02-18-2011, 10:44 AM   #4
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
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.
 
Old 02-18-2011, 11:04 AM   #5
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,056

Original Poster
Rep: Reputation: 78
Which environmental variables? I'm familiar with PATH but not the others.
 
Old 02-18-2011, 11:08 AM   #6
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
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
 
Old 02-18-2011, 02:37 PM   #7
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,056

Original Poster
Rep: Reputation: 78
well OSX is basically BSD Unix. Any linux vars come to mind?

I'm about to try this....
 
Old 02-18-2011, 02:52 PM   #8
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Found this man http://stackoverflow.com/questions/1...iables-in-os-x

Hopefully that gives you the information you need!
 
Old 02-18-2011, 03:46 PM   #9
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,056

Original Poster
Rep: Reputation: 78
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"....
 
Old 02-18-2011, 03:48 PM   #10
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
That one we will have to get someone else with just a weeee bit more experience with OSX....
 
Old 02-18-2011, 03:49 PM   #11
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
OR I can google a bit and come across this link....
http://juliusdavies.ca/how_to_uninst..._from_mac.html

Ehh, is that any better?
 
Old 02-18-2011, 05:45 PM   #12
sneakyimp
Senior Member
 
Registered: Dec 2004
Posts: 1,056

Original Poster
Rep: Reputation: 78
Quote:
Originally Posted by corp769 View Post
OR I can google a bit and come across this link....
http://juliusdavies.ca/how_to_uninst..._from_mac.html

Ehh, is that any better?
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.
 
Old 02-18-2011, 05:51 PM   #13
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
I would think that it would.... LOL

But awesome man, glad to help out.
 
  


Reply



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
How to remove script injection from .php and .html files spithakos Linux - Security 14 09-22-2011 03:11 PM
Add/Remove php service (Debian GUI) malesandro Linux - Software 1 12-22-2005 10:03 PM
php apache or php cgi - php learner rblampain Linux - Security 3 12-17-2004 11:10 PM
PHP-Remove multiple chars Boby Programming 1 10-01-2004 08:34 PM
How to remove a php zend extension docbrazen Linux - Software 0 01-19-2004 02:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:13 AM.

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