I am trying to make TOMCAT6 support PHP in CENTOS, but I don't know how, have been searching the solutions, but none of them works
Please advise
thanks
I have both PHP and java running on my server, but with a different approach. I have apache running with a php interpreter, and then tomcat running seperately. I use mod_jk to create a vhost for tomcat, and obviously a regular vhost for php.
This means that you must have java and php running under different domains or subdomains, but can have them both on the same server.
Related
perlbrew is a tool to manage multiple installations of Perl on your system, making it easy to, say, quickly run a suite of test scripts against many different versions of Perl.
Is there anything like that for PHP? For now when I want to change the version of PHP that my system uses, I'll go into the build directory for my desired version and run make install.
Here's one: http://www.navicopa.com - it allows you to switch between different versions of php in one click (just install them into different directories)
And here's a free one: https://github.com/c9s/phpbrew
Also - you might like this solution as an alternative, if you don't want to use side software: https://stackoverflow.com/a/5299385/1337343
Also missed that you use linux environment, so you would really like this: https://github.com/tobiasgies/php-switch
Install all php versions you need and switch between them using this tiny bash script.
Maybe phpfarm could help you...
When you run ./configure, add --prefix=/usr/local/php-{version} (replacing {version} with the php version). Then to run a script with a certain version:
/usr/local/php-{version}/bin/php script.php
To run under a CGI environment
Make a symlink from /usr/local/bin/php-cgi to /usr/local/php-{version}/bin/php-cgi and then remake the symlink and restart the server when you want to switch php versions.
Maybe light offtopic, but for local development under windows some WAMP stacks provide excellent one-click switching of php versions. i had positive experiences with:
http://www.wampserver.com
http://www.uniformserver.com
Not sure whether this is all clear for you, but let me know if it's not :)
cli
For simple cli testing you can just install each version into their own folders, e.g. /usr/local/php-5.4/bin, /usr/local/php-5.3.10/bin, etc.
fastcgi
For some time you can run PHP in FastCGI mode. You can let a few versions run simultaneously and bind them to different ports, e.g. :9000, :9001, :9002, etc.
The next step is to set up multiple name based virtual hosts in either Apache, Nginx, Lighttpd or Node.js. Each virtual host binds to another FastCGI process and therefore uses a different version of PHP.
Maybe this is overkill for what you need, but if you don't mind using virtual machines Vagrant may be helpful.
There's a webserver which serves dynamic JSP contents, but we would like to serve some PHP contents too.
Is it possible to install PHP 5 and MySQL on Apache Tomcat 6.0.32 WITHOUT stopping the service of current contents, uninstalling Tomcat, installing the Apache HTTP Server (via AppServ, XAMPP or something similar which installs PHP, MySQL and phpMyAdmin too with just some simple clicks), and after that, configuring the Apache Tomcat Connector?
Currently I don't have the opportunity to configure the mentioned "target" webserver, but I installed Tomcat on my local machine, so with my own webserver I can try doing anything suggested.
I know there are lots of questions related to the topic even on stackoverflow, but none of them answered my question.
Thank you in advance!
You could use Quercus or JSR223 + PHP-bridge to read/parse/run PHP files using Java.
As to MySQL, as being just a simple and standalone DB server, it doesn't require a specific webserver. MySQL totally doesn't care wat webserver you're running. Just install and configure it the usual way.
Oh, please note that the Apache Tomcat Connector requires Apache HTTPD server. So if you don't want to install Apache HTTPD, then the Tomcat Connector is worthless to you.
Tomcat supports CGI so why not install php5-cgi?
I don't know whether it's possible to install Apache Tomcat without HTTPD, but I can answer your question partially:
By default, it's not possible. I don't know why, but package-installers (I used YUM at EC2) require you to install HTTPD too as a dependency of PHP. So if your package-installer requires this too, you need to build PHP from source (which isn't very hard though). Edit: I'm using FastCGI, 'just' PHP might not work, but it would surprise me though. (FastCGI works since, just like MySQL, you can install PHP-FastCGI on a separate server).
MySQL is fully independant. Since you can also install it on a separate server (db-server) without PHP and a HTTP-server, it's possible to install MySQL without HTTPD.
So right now I'm rocking Apache 2.2, which I've had running for a couple years (only for local purposes). With Apache, I have PHP 5 installed. Recently I installed Tomcat 7 for Java Servlet support (GWT specifically). I also have Tomcat supports SSL (on a separate port which is annoying but manageable for now).
Here's my problem. GWT cannot use PHP pages and PHP cannot use SSL (unless I install that on Apache). What would be the best solution to get GWT, PHP, and SSL on single server or at least able to interact.
I was thinking maybe install PHP on Tomcat because it already has GWT and SSL ready but a quick Google search didn't show promise on this. Another option I've heard is that Apache can forward certain requests (such as Java Servlets) to Tomcat. I'm hoping someone has a quick answer to save me the headache of Googling.
Also, Apache is running on port XXX1, Tomcat XXX2, and Tomcat SSL XXX3. Is there a way to get these all on a single port? I'm guessing it'd have to be configured at the router/gateway and forwarded to each correct port?
Use Apache as a proxy for Tomcat, and have the SSL configured on Apache. You'll need to use mod_proxy for this. A sample configuration would look like this:
ProxyPass /tomcat/ http://127.0.0.1:XXX2/
You'd then access the Tomcat resources by prefixing a /tomcat/ to the URL path.
Resin is a Java application server with a full PHP5 implementation.
http://quercus.caucho.com/
Just completing the answer given by Jon, take a look to this configuration to serve the Tomcat applications from Apache.
Tomcat, it seems, can run PHP. Found that answer on another Thread which points to this handy tutorial. I'd still like to know if anyone has another solution?
Iam not able to get familiar with XAMPP interface on Windows7 (Only prior experiencxe is with HTML,C,C++).
How to proceed to begin development work in PHP and MySQL and test developed contents using Apache Server.
Please help to understand its working flow.
Thanks in Advance.
First, find a good PHP book or tutorial to learn PHP. There are plenty out there, just Google or visit the PHP homepage.
As you follow the book or tutorial, save your .php files in the XAMPP htdocs folder. This will let you view your results using the XAMPP web server. For example, if you write a PHP script called test.php and save it in the htdocs folder, you can access it on your local XAMPP server via http://localhost/test.php.
XAMPP includes phpMyAdmin, which lets you manage the included MySQL database. You can learn more about phpMyAdmin here.
Be sure to read the XAMPP documentation so that you know how to start up Apache and MySQL and access phpMyAdmin.
XAMPP is only a service that provides a webserver, server side language (PHP), database and interface to connect to said interface. Once it is installed you are good to go, all you need to do is turn on Apache, then MySQL. All the rest of the installation requirements should be done automatically upon installation.
Maybe it is better to explain your particular issue...
I was beginning from Denwer. It was very easy to begin with him. He includes php, mysql, apache.
http://www.denwer.ru
You have to run the Apache server for php and the MySQL server for MySQL :D. You can run it by starting the XAMPP Control and than run them. Now you can go to the localhost http://localhost/
There are some instructions.
I hope it is useful.
Marcel
Do you really need XAMPP? Sumit, I also have Win7/x64 on one machine, where I installed
Apache 2.2.16 for 32bit Windows
PHP 5.3.2 (x32 Windows VC6 install binary)
Perl 5.12.1 32bit x86 from Activestate
MySQL 5.1 32bit x86 Windows installer)
I installed all-32-bit stuff (even if on 64bit Windows) because that guarantees you a much simpler life. You can handle or maintain every component individually, for including PHP or Perl into Apache, you just change a line or two in the Apache config file. There's no magic at all with all these programs. Install them by yourself and learn a lot in the process.
I wanted to know, is a server that supports ASP.NET and PHP on the same box common? wordpress/mediaWiki/phpBB3 seem like a nice combo but i am developing a ASP.NET project.
Most windows webhosts support PHP as well. Big drawback to PHP being lack of URL rewriting support. IIS handles multiple handlers pretty well, so running both concurrently isn't even particularly tricky.
Take a look at the Microsoft Web Platform if you want to have a drop in replacement, otherwise PHP will install into IIS as a SAPI module or, if you are using IIS 7 you can also run it as FastCGI.
php|architect is also giving away the May 2009 issue which is all about running PHP on Windows.
Using IIS will certainly help you.
Download Microsoft's PHP for IIS, here, http://www.microsoft.com/web/platform/phponwindows.aspx
This'll help you start.
Don't forget to edit php.ini either in C:/Windows, or whereever the application was installed to, in order to ensure everything is set optimally for you.
We know PHP hasn’t always run smoothly on the Windows platform, so we’ve now optimized Windows Server to support your PHP applications through a new component: FastCGI. FastCGI works as an interface between PHP engine and IIS, and it ensures that PHP runs much faster than with CGI and way more reliable than PHP ISAPI.
with IIS you can host Asp.net and PHP
Another option is the Phalanger project that integrates PHP so you can use it either separately or inside ASP.NET on IIS.
It is compiled down so it should run much faster than standard interpreted php.
Phalanger
You could use Ubuntu Server (which a variety of hosting providers offer), among other GNU/Linux distros. Take a look at http://www.google.com/search?q=ubuntu+server+hosting , then just get apt-get Mono for ASP.NET, along with PHP 5:
sudo apt-get install mono-xsp2 php5
and anything else you need.