removing php on a mac with tiger

  • Follow


<?php phpinfo() ?>
gives me 5.0.4

but at the terminal php-v gives me 4.3.11 even though I trashed the two
php folders which had
php_version.h of 4.3.11 in them and did a reboot.

In the past, I have had trouble when two different versions of a
software were installed. How do I get rid of the php that came with
Tiger so I only have one php? 

thanks

anne

0
Reply anne (264) 3/27/2006 11:38:55 PM

In addition to two directories with php_version with the wrong number,
I found a php
on the path, in /usr/bin and removing all the php files in there
changes
php -v to go blank.

Don't know if this is ok or if I am headed for trouble!

0
Reply anne (264) 3/27/2006 11:59:03 PM


I tried downloading the binary 5.1.2 and running
../configure --enable-fastcgi --enable-discard-path
--enable-force-cgi-redirect --with-mysql --with-java

but it did not find the mysql files
so I had to run without mysql hoping this php would support mysql
../configure --enable-fastcgi --enable-discard-path
--enable-force-cgi-redirect
make
sudo make install
but the test file in html did not change, it still said 5.0.4

then I went and got the package which includes support for mysql but
not cfgi.
http://www.entropy.ch/software/macosx/php/

that installed, and the test file in html now says 5.1.2 but I don't
find any mention of fcgi
so it looks like I have updated php, but I haven't figured out how to
compile php with fcgi.

php -v no longer works in the terminal window.

why doesn't
../configure --enable-fastcgi --enable-discard-path
--enable-force-cgi-redirect --with-mysql --with-java

work?

0
Reply anne (264) 3/28/2006 2:40:34 AM

anne001 wrote:
> I tried downloading the binary 5.1.2 and running
> ./configure --enable-fastcgi --enable-discard-path
> --enable-force-cgi-redirect --with-mysql --with-java
> 
> but it did not find the mysql files
You probably need to point the conf script at the mysql development 
files.  If you have these.

> so I had to run without mysql hoping this php would support mysql
> ./configure --enable-fastcgi --enable-discard-path
> --enable-force-cgi-redirect
> make
> sudo make install
> but the test file in html did not change, it still said 5.0.4
> 
The PHP that is referenced by the mod_php DSO is not necessarily the 
specific PHP you've installed to (I presume) /usr/local.  OS X has most 
of the system, including convenient dev tools like this, in /Library or 
/System with softlinks back to /usr/ or /private as necessary.  Unless 
you installed a new DSO to the appropriate directory and restarted 
Apache, it will continue to use the DSO it already has available.

This way, you can have any number of PHP installs, as long as they are 
kept separate from each other.

> then I went and got the package which includes support for mysql but
> not cfgi.
> http://www.entropy.ch/software/macosx/php/
> 
> that installed, and the test file in html now says 5.1.2 but I don't
> find any mention of fcgi
> so it looks like I have updated php, but I haven't figured out how to
> compile php with fcgi.
> 
> php -v no longer works in the terminal window.
> 
Define "no longer works".  I assume that all this hacking as left you 
with PHP in /usr/local.

> why doesn't
> ./configure --enable-fastcgi --enable-discard-path
> --enable-force-cgi-redirect --with-mysql --with-java
> 
> work?
> 
Because it assumes you know exactly what you are doing.  Do you have all 
the necessary third party stuff, and can the conf script find it?  Did 
you remove something that the conf script now needs?  Are the resulting 
headers, libraries and executables in a sane location?  Can Apache find 
PHP and PHP find MySQL and so on?

I recommend something like Fink or Darwinports to get the libraries, 
tools and addons you want to play with.  This leaves the stock install 
alone.  Then you can configure Apache to use whatever DSO you like.

Otherwise, you are going to have to stare at the PHP README and INSTALL 
docs for a bit, and figure out how to get all the necessary bits and 
pieces for it.  A typical technique is to use Fink to get the grungy 
development libraries (i.e., I think there is a mysql-dev package) and 
then point autoconf at /sw for the stuff that is not in the default 
search path(s).  This often means tweaking the CFLAGS and LDFLAGS variables.
0
Reply clvrmnky.invalid (895) 3/28/2006 5:15:26 PM

I tried using darwinport but got an error message, it seems you can't
use darwinport
with both apache and fastcgi.
is this what you meant?
>I recommend something like Fink or Darwinports to get the libraries,
>tools and addons you want to play with.

this is what I tried.
sudo /opt/local/bin/port -v install php5 +apache +mysql5 +fastcgi
The following dependencies failed to build: libmcrypt libpng libxml2
libxslt mhash mysql5 tidy tiff

I have the configure file compiling without error with
 ./configure --prefix=/usr/local --program-suffix=5 --enable-fastcgi
--enable-discard-path --enable-force-cgi-redirect
--with-mysqli=/usr/local/mysql/bin/mysql_config
make
sudo make install

 I need to find the option to tell it where to put the directories, and
then modify the apache config file
I think.

php -v command not found.
I moved the package php5 to a php5old so I would know if my install
would work, and so test
does not work either. Before I moved the folder though php-v no longer
worked.
guess php5 by the entropy package is not on the path!

indeed if I move the entropy package back to php5 folder and type
/usr/local/php5/bin/php -v
I get
PHP 5.1.2 (cli) (built: Jan 14 2006 23:57:00)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
 
good to know php-v works if php is set properly etc.  

anne

0
Reply anne (264) 3/28/2006 10:30:22 PM

I found a website which shows how to compile php for tiger

actually the test file has the configure command so I could probably
have taken Mark's package install
http://www.entropy.ch/software/macosx/php/
looked at the test file, and added the 3 fcgi commands at the end.

'./configure' '--prefix=/usr/local/php5' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--with-apxs' '--with-ldap=/usr'
'--with-kerberos=/usr' '--enable-cli' '--with-zlib-dir=/usr'
'--enable-trans-sid' '--with-xml' '--enable-exif' '--enable-ftp'
'--enable-mbstring' '--enable-dbx' '--enable-sockets'
'--with-iodbc=/usr' '--with-curl=/usr' '--with-config-file-path=/etc'
'--with-mysql=/usr/local/mysql' '--enable-fastcgi'
'--enable-discard-path' '--enable-force-cgi-redirect'

since I used Mark's package before I used this. the apache config file
should be ok with this new install, and hopefully I have fastcgi! I
will have to figure out how I can tell!

0
Reply anne (264) 3/29/2006 2:43:57 AM

actually I probably need to give some info to apache on fcgi as well as
this site suggests
http://www.k4ml.com/wiki/server/apache/php-fastcgi

but first I have the same problem as when I started.
127.0.0.1 has the config option with fcgi and the built date, March 28,
and the folder php5 has files from march 28, but php-v gives a built
date of mar 27 and does not mention cgi-fcgi

 /usr/local/php5/bin/php -v
PHP 5.1.2 (cli) (built: Mar 27 2006 20:48:59)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies

so I don't know why this did not get updated as well, and what I really
have, cli or cgi-fcgi?

0
Reply anne (264) 3/29/2006 11:16:58 AM

so strange, I looked for php, and removed everything in /usr/local/bin
of date mar 27
and typed

/usr/local/bin/php5 -v
PHP 5.1.2 (cgi-fcgi) (built: Mar 27 2006 20:48:53)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies

and now it says cgi-fcgi, but the built date is still wrong! I removed
all files/folders with contained the string php  built march 27 and
still it says built march 27. Ach. I still don't have a clean install!

0
Reply anne (264) 3/29/2006 12:08:03 PM

7 Replies
26 Views

(page loaded in 0.118 seconds)


Reply: