LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   AIX (https://www.linuxquestions.org/questions/aix-43/)
-   -   AIX 6.1Apache 2.2.11 + PHP 5.1.6 installation help (https://www.linuxquestions.org/questions/aix-43/aix-6-1apache-2-2-11-php-5-1-6-installation-help-721981/)

Voltxion 04-27-2009 07:53 AM

AIX 6.1Apache 2.2.11 + PHP 5.1.6 installation help
 
So I am not very experienced with this OS.. well that is a misleading statement.. I actually have never used AIX before

I have not really installed apache and php before from src .

I have gotten all my pre-requisite packages installed for apache and php .. got GCC installed now I need help getting apache 2.2.11 and PHP 5.1.6+ installed.

even a push in the right direction.
(needed apache modules = mod_rewrite)
(needed php modules = soap and PECL/SSH2)

All help is greatly appreciated.

-Thank you [Voltxion]

vitalstrike82 04-27-2009 12:47 PM

I assume you have download the apache server and php. i will be using y own version of apache and php.

For apache:
Code:

cd to the directory where the installer resides
gzip -d <name_of_apache_directory.tar.gz>
tar xvf <name_of_apache_directory.tar.gz>
cd <name_of_apache_directory>

Next issue these commands to configure, make and install
Code:

./configure --prefix = /usr/local/apache2
make
make install

After installing, you can start using this command:
Code:

/usr/local/apache2/bin/apachectl -k start
For your case, you mention bout: (needed apache modules = mod_rewrite)
You can find them by using this directory path:

cd /usr/local/apache2/includes
You can find the file in that directory

As For Php
Untar the php directory
Code:

tar jxvf <name_of_php_directory.tar.bz2>
Next configure the php to be use with apache, tjhen make and install
Code:

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs
make
make install

Next issue this command where copy the .ini file to path /usr/local/php/lib/ and use editor to open up the file. If nano not available, you can try vi editor

Code:

cp php.ini-recommended /usr/local/php/lib/php.ini
nano /usr/local/php/lib/php.ini

Update the php.ini as follows (search for the doc root in php.ini)
doc_root="/usr/local/apache2/htdocs/"

pecl i think can be found in the php bin directory.

These are the steps i use to install. Hope you can install without any problems too. :)

Voltxion 04-28-2009 07:01 AM

this is the error I get when I do Make install for php

Quote:

# make install
echo '\
\
Installing PHP SAPI module: apache2handler
/usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' libphp5.la /usr/local/apache2/modules
rm -f /usr/local/apache2/modules/libphp5.so
/usr/local/apache2/build/libtool --mode=install cp libphp5.la /usr/local/apache2/modules/
cp .libs/libphp5.lai /usr/local/apache2/modules/libphp5.la
cp .libs/libphp5.a /usr/local/apache2/modules/libphp5.a
chmod 644 /usr/local/apache2/modules/libphp5.a
ranlib /usr/local/apache2/modules/libphp5.a
libtool: install: warning: remember to run `libtool --finish /tmp/apache/php-5.1.6/libs'
Warning! dlname not found in /usr/local/apache2/modules/libphp5.la.
Assuming installing a .so rather than a libtool archive.
chmod 755 /usr/local/apache2/modules/libphp5.so
chmod: /usr/local/apache2/modules/libphp5.so: A file or directory in the path name does not exist.
apxs:Error: Command failed with rc=65536
.
make: 1254-004 The error code from the last command is 1.


Stop.
Ive gotten this everytime so far, I can't figure out how to fix it.

Voltxion 04-28-2009 09:23 AM

Well I gave up since I can't figure out how to change the default loader to the GNU loader and the buildtools to GNU ones so I ended up using this bundle ftp://ftp.hvcc.edu/pub/pware/aix53/bundles/amp I found it through IBMs website for AIX.

Weeds2009 07-14-2009 10:35 AM

I figured this out. Dumbest thing I've ever seen.

Installing PHP SAPI module: apache2handler
/usr/local/apache2/build/instdso.sh SH_LIBTOOL='/usr/local/apache2/build/libtool' libphp5.la /usr/local/apache2/modules
rm -f /usr/local/apache2/modules/libphp5.so
/usr/local/apache2/build/libtool --mode=install cp libphp5.la /usr/local/apache2/modules/
cp .libs/libphp5.a /usr/local/apache2/modules/libphp5.a
cp .libs/libphp5.lai /usr/local/apache2/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /usr/sys/inst.images/php/php-5.3.0/libs'
chmod 755 /usr/local/apache2/modules/libphp5.so
chmod: /usr/local/apache2/modules/libphp5.so: A file or directory in the path name does not exist.
apxs:Error: Command failed with rc=65536

It can't find libphp5.so because the first thing the 'make install' did was rm -f the exact file it needs to continue. The file it's deleting actually exists on the system in a different directory. In my case it was the directory I did the initial 'make' in. So the solution I used was to open two sessions. In the first session type out the cp command that copies the original file to the /usr/local/apache2/modules directory, DON'T hit the enter key. Example:

cp /usr/sys/inst.images/php/php-5.3.0/.libs/libphp5.so /usr/local/apache2/modules/

Next, in the second session, run the 'make install'. Right away, click back to your first session and hit 'enter' to copy it back just after the Makefile does and rm -f on the libphp5.so file. Timing is everything, so it may take a couple tries. Your just recopying the the libphp5 file back to where the Makefile is looking for it so it can continue. It had to be done while your 'make install' is running. Stupidest thing I've ever seen in a compile, but this hack job works and it managed to finish successfully.

Good luck :)

priya117 06-20-2013 06:12 AM

required the actual output and test PHP
 
hi i have configured PHP and make make test was success , But durin make insatll getting the below error and while creation of PDO headers the insatllation is getting stoped and coming back to the folder ,

I m not sure wheather this installation was success or no and there is not error message also , can any one help on this

And also can any one let me knwo how to test this installation success ?

PHPH installed was : 5.4.16

$ make install
Installing PHP CLI binary: /opt/Programs/PHP//bin/
Installing PHP CLI man page: /opt/Programs/PHP//php/man/man1/
Installing PHP CGI binary: /opt/Programs/PHP//bin/
Installing build environment: /opt/Programs/PHP//lib/php/build/
Installing header files: /opt/Programs/PHP//include/php/
Installing helper programs: /opt/Programs/PHP//bin/
Installing man pages: /opt/Programs/PHP//php/man/man1/
page: phpize.1
page: php-config.1
Installing PDO headers: /opt/Programs/PHP//include/php/ext/pdo

NevemTeve 06-20-2013 08:20 AM

And where is the error message? This is how 'make install' ends.
Try this too (you should see current dates):
Code:

ls -l /usr/local/bin/php /usr/local/libexec/apache2/libphp5.* \
/usr/local/etc/php.ini /usr/local/lib/php.ini

Edit: in your case add prefix /opt/Programs/PHP/

priya117 06-20-2013 08:55 AM

Thanks for your kind reply friend , then my install is success :)

I am struck with one more issue i.e presentely i am working on non-root access and I had install my apache and php, but i could not see the libphp5.so file in my apache modules folder not sure during wt phase this files gets genrated , is there any way to get package where i can insatll and copy this libphp5.so file can you provide me the link or some suggestions like when can i get this libphp5.so loaded ?

Thanks in advance

NevemTeve 06-20-2013 09:32 AM

If you didn't specify something like LDFLAGS=-Wl,-brtl you most likely got a file called libphp5.a containing the shared object. That might be quite okay, or you might want to try to extract the shared object from it. (Use 'ar' or Midnight Commander)

Hopefully, you have a logfile of the make-process (eg: (make all && make install) 2>&1 | tee log.make), so you can search in it for 'libphp5.la' or 'Installing PHP SAPI module' or 'libexec/apache2'

Michael AM 06-20-2013 03:42 PM

I have been very frustrated with packaging for AIX, and I have never quite finished the php build. This has always been a difficult one. Reading this makes me think it may be time to start again.

The projects I have done (e.g., apache 2.2.22 and 23 and 2.4.3 and 2.4.4) and, perhaps needed for the make install of php - is the coreutils install version.

There are, subtle, and unknown differences in the installs. I have experimented with having /usr/ucb earlier in the path that /usr/bin to get ucb install. That has also worked in some instances.

I am sure the IBM one is standards compliant - and GNU packaging seems to have their own standard - hence the need for another install program.

btw - the logic for remove of the file is because if the file is active you cannot copy over it. using slibclean should have been enough - but that was a hack someone thought of YEARS ago. Very very hard to get it changed.

Ah yes. If you are curious, my packages can be found via http://dl.aixtools.net

Michael AM 06-21-2013 09:39 AM

seems i broke my virtual host entry, so the downloads are offline til i get home. my apologies.

cliffordw 06-21-2013 11:00 AM

Quote:

Originally Posted by priya117 (Post 4975292)
$ make install
Installing PHP CLI binary: /opt/Programs/PHP//bin/
Installing PHP CLI man page: /opt/Programs/PHP//php/man/man1/
Installing PHP CGI binary: /opt/Programs/PHP//bin/
Installing build environment: /opt/Programs/PHP//lib/php/build/
Installing header files: /opt/Programs/PHP//include/php/
Installing helper programs: /opt/Programs/PHP//bin/
Installing man pages: /opt/Programs/PHP//php/man/man1/
page: phpize.1
page: php-config.1
Installing PDO headers: /opt/Programs/PHP//include/php/ext/pdo

Hi there,

The last time I did this, was for PHP version 5.3.10, but I'm not aware of major changes in the process.

If the above outout is all you saw from "make install", it doesn't look like the Apache module was installed. I got messages specific to libphp5.so before the "Installing PHP CLI binary" above, similar to this:

Code:


# make install
Installing PHP SAPI module:      apache2handler
/opt/glacier/apache/build/instdso.sh SH_LIBTOOL='/opt/glacier/apache/build/libtool' libphp5.la /opt/glacier/apache/modules
rm -f /opt/glacier/apache/modules/libphp5.so
/opt/glacier/apache/build/libtool --mode=install cp libphp5.la /opt/glacier/apache/modules/
cp .libs/libphp5.a /opt/glacier/apache/modules/libphp5.a
cp .libs/libphp5.lai /opt/glacier/apache/modules/libphp5.la
libtool: install: warning: remember to run `libtool --finish /opt/glacier/src/php-5.3.10/libs'
chmod 755 /opt/glacier/apache/modules/libphp5.so
[activating module `php5' in /opt/glacier/apache/conf/httpd.conf]
Installing PHP CLI binary:        /opt/glacier/php/bin/
...

Taking one step back, when I first tried the install, I also got "chmod: /usr/local/apache2/modules/libphp5.so: A file or directory in the path name does not exist." similar to those mentioned in earlier posts. I worked around this by editing the apache/build/instdso.sh script as follows:
  1. comment out '$CMD || exit $?' within 'if test "$SYS" = "AIX"'
  2. comment out "rm -f $TARGETDIR/$TARGET_NAME" (2nd last line)
After this I manually copied .libs/libphp5.so to apache/modules/libphp5.so
and rerun make install.

Can you post the "configure" command options you used? That might help us understand the setup. In particular, did you use an "--with-apxs2" option?

As an aside, one alternate option might be to use Michael Perzl's PHP & Apache packages. I've switched from going through this pain myself to using his packages, and am running it happily on a number of servers. See http://www.perzl.org/aix/index.php?n=Main.Php. You'll need root access to install this, though.

Good luck!

NevemTeve 06-29-2013 03:07 AM

From my point of view the root of all these problems is AIX's tradition to put shared objects into *.a acrhives. Everyday Unices don't do that, so programs like PHP aren't really prepared for it. I usually do every compilation from a script sg like this:
Code:

#!/bin/sh

make distclean

export CFLAGS='-maix32 -mtune=native ...'
export LDFLAGS='-maix32 -Wl,-brtl ...'

./configure ... 2>&1 | tee log.configure

<progam/platform specific hacks>

(make all && make install) 2>&1 | tee log.configure

Other -Defines also go into CFLAGS, for example the ones that cause Large File Support (note: be careful with that: either use it in every program or none; for example Apache with LFS and PHP without LFS won't work together -- of course that will cause other problems in PHP (I might explain, if anyone is interested) -- compilation/installation in AIX is a challenging game)

Michael AM 07-24-2013 03:07 AM

From my point of view, .a archives are normal (since 1978!). The .so naming convention for something that was already working using ranlib was just something new/different. Maybe there is something else different as well.

However, as far as AIX and archives are concerned - the issue is not really the file extension, except where applications demand it. Frequently hard and/or soft links are used to link .so and .a archives. The more important element is the name of the object in the archive - and when .so is again demanded, rather than .o, run-time linking may fail.

The command to know - on AIX - is
Quote:

dump -H /full/program/name
as this will tell you what libraries are sought, and where the application expects to find them.

NevemTeve 07-24-2013 04:13 AM

Well, if you didn't experience problems when compiling PHP, you certainly shouldn't change anything.


All times are GMT -5. The time now is 04:23 AM.