2

I need to install php on a CentOS machine and configure it to work with tomcat5 and mysql

Anyone know how i can do this?

the home folder for tomcat and mysql is

/usr/share/tomcat5
/usr/share/mysql

for php, I downloaded from http://php.net/downloads.php, PHP 5.3.10 (tar.gz)

i extracted the files php source to

/usr/local/src/php-5.3.10

Now I'm unsure on how to proceed with the installation of php to work with tomcat5 and mysql..

Need help.

Thanks in advance.

2
  • Tomcat is a Java application server. While it is technically possible to run a PHP application within Tomcat, you need to do all sorts of patching and other stuff making it non-ideal. Just use Apache HTTPD and mod_php, save yourself a lot of trouble.
    – user80776
    Feb 3, 2012 at 9:59
  • yum install httpd php php-mysql should be enough to get you started
    – user80776
    Feb 3, 2012 at 10:00

2 Answers 2

1

I support sam idea of using apache (or httpd as called on centos) instead of tomcat to run PHP.

All you need to get started is to install httpd, php module, and php-mysql module. After installing the required modules, you need to reload/restart your httpd server.

If you still need to have tomcat installed to run Java-based services, you can still do that by installing both apache and tomcat. You can use apache module mod-jk to link them together. In this case, the requests will be received by apache and it will forward the relevant requests to tomcat (according to configuration) which should be running on different port (other than 80).

0

You can run PHP in Java using Quercus but like the others have said unless you have some unusual requirement to use Tomcat as the HTTP server you're really better off using Apache and mod_php.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .