Re: php and Oracle client on mac - followup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]




On Jun 11, 2008, at 07:51 AM, ahmed nabel wrote:


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 and Oracle client on mac - followup


On Jun 10, 2008, at 17:31 PM, ahmed nabel wrote:


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

Does this include support for 64bit applications?


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

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.


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

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 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...).

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!

-- Dale

_________________________________________________________________
Great deals on almost anything at eBay.co.uk. Search, bid, find and win on eBay today!

-- Dale



Attachment: PGP.sig
Description: This is a digitally signed message part


[Index of Archives]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [Postgresql]     [PHP Books]     [PHP Databases]     [PHP SOAP]
  Powered by Linux