note 25316 deleted from ref.java by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 09:03:49 +0000 |
| Subject: | note 25316 deleted from ref.java by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196871@lists.php.net to get a copy of this message | ||
Note Submitter: aruntheking at hotmail dot com
----
Installing PHP 4.2.3 on Red Hat Linux7.2
with Java Support-Arunoday
-------------------------------
PHP as CGI module
------------------
1. Download PHP from www.php.net
2. Copy the file in the folder you want to have it installed like
/usr/local
3. Unpack the file using the following commands
gunzip php-4.2.3.tar.gz
tar xvf php-4.2.3.ta
This will create a directory php-4.2.3.
4. cd into the above mentioned directory and type
./configure --with-java=<java directory>
You can add more options with
configure.
For a full list of options type ./configure --help | more
5. If configure doesn't through any error then type make
6. To test make you can type make test
7. To complete the installation type make install
In all probability the actual binary that this will create
by the name php will be in
the /usr/local/bin directory.
This file should then be copied to your
cgi-bin directory[the webservers cgi-bin]
in my system i issued the following command
cd /usr/local/bin/php /var/www/cgi-bin/php.cgi
8. Modify the php.ini with the following lines
[java]
java.class.path=/usr/local/lib/php/php_java.jar
java.library.path=/usr/local/lib/php
/extensions/no-debug-non-zts-20020429
java.home=/usr/local/j2sdk1.4.0_02
java.library=java.so
extensions_dir=/usr/local/lib/php/extensions/no-debug-non-zts-20020429
extension=java.so
in all probability the php.ini file will be
in the php4.2.3/pear/tests directory
- u will need to copy it to the
/usr/local/lib directory and add the above lines
You will also need to cd into the directory specified in java.library.path
above and type the following
ln -s java.so libphp_java.so
This will make a symbolic link to java.so file through libphp_java.so.
A call to any of your PHP file will have to be like the following:
http://<yourhostname>/cgi-bin/php.cgi?<yourfilename>.php
PHP as Dynamic Shared Object
----------------------------
Retrieve PHP binary as mentioned above.
The configiration process will be different and will be as follows:
./configure --with-apxs=/usr/sbin/apxs
--with-java=/usr/local/j2sdk1.4.0_02 --with postgresql
postgresql is optional - u can leave it out if you donot want to use it.
apxs is required as it gives the directive to configure php as a dynamic shared object with Apache.
Advantage, it runs in the same memory space as Apache
and hence accessing of data is faster.
Apart from this there is no need to call the php interpreter (php.cgi) with every call to a PHP
file.
Add the following lines in the php.ini file - it should be in /usr/local/lib
[Java]
java.class.path=/usr/local/lib/php/php_java.jar
:/usr/share/pgsql/jdbc7.1-1.2.jar:/var/www/html
java.home=/usr/local/j2sdk1.4.0_02
java.library=/usr/local/j2sdk1.4.0_02/jre/lib/i386/libjava.so
extension_dir=/usr/local/lib/php/extensions/no-debug-non-zts-20020429
extension=java.so
You will also need to cd into the directory specified in java.library.path
above and type the following
ln -s java.so libphp_java.so
This will make a symbolic link to java.so file through libphp_java.so.
Note: the jdbc7.1-1.2.jar file mentioned in java.class.path
is the JDBC part for Postgresql.