Discussion:
[PHP-INSTALL] php and Oracle client on mac - followup
ahmed nabel
2008-06-10 21:31:57 UTC
Permalink
Hi. This is a followup to a pervious post titled "php and Oracle client on mac".

I had PHP and Apache which come with Mac OS X 10.5.2 both enabled and running (a php page on my website renders correctly).

I tried to install Oracle Client 10g and recompile php to have oci working. What I did:

1. Downloaded, unzipped Oracle client and set its environment varaibles ORACLE_HOME, DYLD_LIBRARY_PATH, and TNS_ADMIN. Also had the correct connection parameters in tnsnames.ora

2. downloaded Apache httpd-2.2.8.tar.gz, unzipped into /usr/local and then:

./configure --enable-layout=Darwin --enable-mods-shared=all

make

sudo make install

3. downloaded php-5.2.5.tar.gz, unzipped into /usr/local and:

./configure --enable-layout=Darwin --enable-mods-shared=all --prefix=/usr --mandir=/usr/share/man --localstatedir=/var --infodir=/usr/share/info --disable-dependency-tracking --with-apxs2=/usr/sbin/apxs --with-kerberos=/usr --enable-cli --with-oci8=/Applications/Oracle/ohome

make


 sudo make install

Now, if I type http://localhost or http://localhost/index.html or http://localhost/test.php (a page which I have created in my Website folder, that is /Library/WebServer/Documents) I get:

Safari can’t open the page “http://localhost/” because it could not connect to the server “localhost”.

If I go to /Library/WebServer/Documents, I still see the older Apache files (which was working).

Can anyone please tell me what went wrong? Or perhaps suggest some way to go because I'm quite new to Mac and php. Thank you for your time. Please inform me if I need to provide more info (logs, etc...).

Best.
_________________________________________________________________
Great deals on almost anything at eBay.co.uk. Search, bid, find and win on eBay today!
http://clk.atdmt.com/UKM/go/msnnkmgl0010000004ukm/direct/0
BuildSmart
2008-06-11 11:13:11 UTC
Permalink
Post by ahmed nabel
Hi. This is a followup to a pervious post titled "php and Oracle client on mac".
I had PHP and Apache which come with Mac OS X 10.5.2 both enabled
and running (a php page on my website renders correctly).
1. Downloaded, unzipped Oracle client and set its environment
varaibles ORACLE_HOME, DYLD_LIBRARY_PATH, and TNS_ADMIN. Also had
the correct connection parameters in tnsnames.ora
Does this include support for 64bit applications?
Post by ahmed nabel
./configure --enable-layout=Darwin --enable-mods-shared=all
make
sudo make install
Why???

It doesn't look like you built it with 64bit support so I doubt
apache will be useable unless you thin out the entire system but in
dong so things will break in a software update so I don't recommend it.
Post by ahmed nabel
./configure --enable-layout=Darwin --enable-mods-shared=all
--prefix=/usr --mandir=/usr/share/man --localstatedir=/var --
infodir=/usr/share/info --disable-dependency-tracking --with-apxs2=/
usr/sbin/apxs --with-kerberos=/usr --enable-cli --with-oci8=/
Applications/Oracle/ohome
If you build your php extensions as shared then you could have
continued using the apple supplied php and just added the extensions
to the php.ini file that you wish to enable.

./configure --enable-layout=Darwin --enable-mods-shared=all --prefix=/
usr --mandir=/usr/share/man --localstatedir=/var --infodir=/usr/share/
info --disable-dependency-tracking --with-apxs2=/usr/sbin/apxs --with-
kerberos=/usr --enable-cli --with-oci8=shared,/Applications/Oracle/ohome

Now, I would check that libphp5.so includes support for 64bit
applications "file /path/to/libphp5.so".

If you build for environment compliancy then it will actually have 4
architectures in the binary (2 for x86 and 2 for PPC).
Post by ahmed nabel
make
sudo make install
Now, if I type http://localhost or http://localhost/index.html or
http://localhost/test.php (a page which I have created in my
Safari can’t open the page “http://localhost/” because it could not
connect to the server “localhost”.
If I go to /Library/WebServer/Documents, I still see the older
Apache files (which was working).
Can anyone please tell me what went wrong? Or perhaps suggest some
way to go because I'm quite new to Mac and php. Thank you for your
time. Please inform me if I need to provide more info (logs, etc...).
It's a build issue, the environment has changed since the 10.4.x days
so it appears these things have gotten the better of you.
Post by ahmed nabel
Best.
_________________________________________________________________
Great deals on almost anything at eBay.co.uk. Search, bid, find and win on eBay today!
http://clk.atdmt.com/UKM/go/msnnkmgl0010000004ukm/direct/01/
-- Dale
BuildSmart
2008-06-11 21:13:46 UTC
Permalink
Hi and thank you for the reply.
1. I will check if the Oracle Client is 64 or not.
This is a requirement to be useable in Leopard so if it's not then
don't add it.
2. How to fix the Apache now? Is it something like delete the
current folder and download a 64 bit version and install it? Where
to download from? and what is the correct commands for building it?
Download???

What is wrong with using the one supplied by apple????

To me it makes no sense to install a second installation of apache
when there is no gain, it only wastes disk space.

Building for multiple architectures can be achieved a number of ways,
the simplest way that should work for you is the following.

# Add these three lines near the top of /private/etc/profile using
pico (SEE: man pico)
export LIBTOOLIZE=glibtoolize
export MACOSX_DEPLOYMENT_TARGET=10.4
export PHPEXT_HOME=/usr/lib/php/extensions/no-debug-non-zts-20060613


Quit terminal and then run it, here's your configure command

CFLAGS="-arch ppc -arch i386 -g -Os -pipe -no-cpp-precomp -pipe -no-
cpp-precomp -arch i386 -arch x86_64" \
CCFLAGS="-arch i386 -arch x86_64 -g -Os -pipe " \
CXXFLAGS="-arch i386 -arch x86_64 -g -Os -pipe " \
LDFLAGS="-arch i386 -arch x86_64 -lresolv" \
TEXI2HTML="/usr/bin/texi2html -subdir ." \
./configure \
--disable-dependency-tracking \
--prefix=/usr \
--mandir=/usr/share/man \
--localstatedir=/var \
--infodir=/usr/share/info \
--enable-cli \
--enable-mods-shared=all \
--with-apxs2=/usr/sbin/apxs \
--with-kerberos=/usr \
--with-oci8=shared,/Applications/Oracle/ohome

Do not issue "make install"!!!!!

You are only interested in oci8.so and "find . -name oci8.so" will
locate it, after a successful "make" command, this file gets copied
to "/usr/lib/php/extensions/no-debug-non-zts-20060613/"

Be sure it's build with 64bit support, use "file $(find . -name
oci8.so)" to test it, if it is then copy it to.

You can copy it with:
cp oci8.so $PHPEXT_HOME/

Of course you would be better off using the exact same configure
flags that apple used for your php and add "--disable-dependency-
tracking" if it's not included along with adding the modules you want
to add as "shared".

An even better solution is you generate a clean build environment and
build it there so you don't mess up your OS.
3. I searched my computer for php.ini and didn't find any, I found
php.ini-dist and php.ini-recommended. I also searched for
libphp5.so and could not find such a file. I use the Finder File>Find.
Finder???

Stop using the finder to browse and search, you'll end up tainting
and or corrupting the environment, see "man find".

You built PHP, it may have broken apache, start by looking at "file /
usr/libexec/apache2/libphp5.so" (Apple's apache module)
Where to download the php 64 from and what are the correct commands
to build it adding the --with-oci8=shared,/Applications/Oracle/ohome?
That will build the oci8 as a loadable extension instead of embedding
it.
Any help is very appreciated.
Best.
________________________________
Date: Wed, 11 Jun 2008 07:13:11 -0400
Subject: Re: [PHP-INSTALL] php and Oracle client on mac - followup
Hi. This is a followup to a pervious post titled "php and Oracle client on mac".
I had PHP and Apache which come with Mac OS X 10.5.2 both enabled
and running (a php page on my website renders correctly).
1. Downloaded, unzipped Oracle client and set its environment
varaibles ORACLE_HOME, DYLD_LIBRARY_PATH, and TNS_ADMIN. Also had
the correct connection parameters in tnsnames.ora
Does this include support for 64bit applications?
./configure --enable-layout=Darwin --enable-mods-shared=all
make
sudo make install
Why???
It doesn't look like you built it with 64bit support so I doubt
apache will be useable unless you thin out the entire system but
in dong so things will break in a software update so I don't
recommend it.
./configure --enable-layout=Darwin --enable-mods-
shared=all --prefix=/usr --mandir=/usr/share/man --localstatedir=/
var --infodir=/usr/share/info --disable-dependency-tracking --with-
apxs2=/usr/sbin/apxs --with-kerberos=/usr --enable-cli --with-
oci8=/Applications/Oracle/ohome
If you build your php extensions as shared then you could have
continued using the apple supplied php and just added the
extensions to the php.ini file that you wish to enable.
./configure --enable-layout=Darwin --enable-mods-shared=all --
prefix=/usr --mandir=/usr/share/man --localstatedir=/var --
infodir=/usr/share/info --disable-dependency-tracking --with-
apxs2=/usr/sbin/apxs --with-kerberos=/usr --enable-cli --with-
oci8=shared,/Applications/Oracle/ohome
Now, I would check that libphp5.so includes support for 64bit
applications "file /path/to/libphp5.so".
If you build for environment compliancy then it will actually have
4 architectures in the binary (2 for x86 and 2 for PPC).
make
sudo make install
Now, if I type http://localhost or http://localhost/index.html or
http://localhost/test.php (a page which I have created in my
Safari can’t open the page “http://localhost/” because it could
not connect to the server “localhost”.
If I go to /Library/WebServer/Documents, I still see the older
Apache files (which was working).
Can anyone please tell me what went wrong? Or perhaps suggest some
way to go because I'm quite new to Mac and php. Thank you for your
time. Please inform me if I need to provide more info (logs, etc...).
It's a build issue, the environment has changed since the 10.4.x
days so it appears these things have gotten the better of you.
Best.
_________________________________________________________________
Great deals on almost anything at eBay.co.uk. Search, bid, find and win on eBay today!
http://clk.atdmt.com/UKM/go/msnnkmgl0010000004ukm/direct/01/
-- Dale
_________________________________________________________________
Great deals on almost anything at eBay.co.uk. Search, bid, find and win on eBay today!
http://clk.atdmt.com/UKM/go/msnnkmgl0010000004ukm/direct/01/
-- Dale
BuildSmart
2008-06-12 09:41:47 UTC
Permalink
Post by ahmed nabel
________________________________
Date: Wed, 11 Jun 2008 17:13:46 -0400
Subject: Re: [PHP-INSTALL] php and Oracle client on mac - followup
Hi and thank you for the reply.
1. I will check if the Oracle Client is 64 or not.
This is a requirement to be useable in Leopard so if it's not then
don't add it.
2. How to fix the Apache now? Is it something like delete the
current folder and download a 64 bit version and install it? Where
to download from? and what is the correct commands for building it?
Download???
What is wrong with using the one supplied by apple????
To me it makes no sense to install a second installation of apache
when there is no gain, it only wastes disk space.
Building for multiple architectures can be achieved a number of
ways, the simplest way that should work for you is the following.
# Add these three lines near the top of /private/etc/profile using
pico (SEE: man pico)
export LIBTOOLIZE=glibtoolize
export MACOSX_DEPLOYMENT_TARGET=10.4
export PHPEXT_HOME=/usr/lib/php/extensions/no-debug-non-zts-20060613
I added those three lines.
That's good.
Post by ahmed nabel
Quit terminal and then run it, here's your configure command
CFLAGS="-arch ppc -arch i386 -g -Os -pipe -no-cpp-precomp -pipe -
no-cpp-precomp -arch i386 -arch x86_64" \
CCFLAGS="-arch i386 -arch x86_64 -g -Os -pipe " \
CXXFLAGS="-arch i386 -arch x86_64 -g -Os -pipe " \
LDFLAGS="-arch i386 -arch x86_64 -lresolv" \
TEXI2HTML="/usr/bin/texi2html -subdir ." \
I ran every line of the above separately.
Don't you feel stupid for doing something I didn't tell you to do and
change the instruction I did provide???

You can't split any of that up, it's part of the configure command,
you could have copied and pasted that whole section into the terminal
window and it would have worked.
Post by ahmed nabel
./configure \
--disable-dependency-tracking \
--prefix=/usr \
--mandir=/usr/share/man \
--localstatedir=/var \
--infodir=/usr/share/info \
--enable-cli \
--enable-mods-shared=all \
--with-apxs2=/usr/sbin/apxs \
--with-kerberos=/usr \
--with-oci8=shared,/Applications/Oracle/ohome
When I try to run the above starting from ./configure and the rest
down (in one stream) I get no such file or directory... should I
run the configure from a certain folder?
You need to be in the PHP source directory, and stop using the Finder
to look in directories or search for files, learn how to do things
the unix way or don't do it at all.
Post by ahmed nabel
Do not issue "make install"!!!!!
You are only interested in oci8.so and "find . -name oci8.so" will
locate it, after a successful "make"
does this mean that I have to run make after the ./configure above?
What is confusing is you spoke of building PHP from source but now it
appears you don't seem to have a clue about how to achieve your goal
or even what you are doing cause you didn't understand the simple
instructions I gave you.

I think you are biting off more than you can chew and you would be
better off paying someone else to do it who knows your environment
and knows how to do the work until such time that you can do this
type of work without breaking anything in OS X.

If you're still going to go ahead and try it your self, issue "make"
but do not issue "make install", you do not want to install PHP
itself (despite what you believe), you only want the modules so you
can incorporate them into your working configuration.
Post by ahmed nabel
command, this file gets copied to "/usr/lib/php/extensions/no-debug-
non-zts-20060613/"
Be sure it's build with 64bit support, use "file $(find . -name
oci8.so)" to test it, if it is then copy it to.
cp oci8.so $PHPEXT_HOME/
Of course you would be better off using the exact same configure
flags that apple used for your php and add "--disable-dependency-
tracking" if it's not included along with adding the modules you
want to add as "shared".
An even better solution is you generate a clean build environment
and build it there so you don't mess up your OS.
3. I searched my computer for php.ini and didn't find any, I found
php.ini-dist and php.ini-recommended. I also searched for
libphp5.so and could not find such a file. I use the Finder
File>Find.
Finder???
Stop using the finder to browse and search, you'll end up tainting
and or corrupting the environment, see "man find".
You built PHP, it may have broken apache, start by looking at
"file /usr/libexec/apache2/libphp5.so" (Apple's apache module)
Where to download the php 64 from and what are the correct
commands to build it adding the --with-oci8=shared,/Applications/
Oracle/ohome?
That will build the oci8 as a loadable extension instead of
embedding it.
Any help is very appreciated.
Best.
-- Dale

Loading...