简体   繁体   中英

How to install / setting php in apache TOMCAT

I want to run my php project [my-project] with server tomcat. I copy my project to C:\\Program Files\\Apache Software Foundation\\Tomcat 8.0\\webapps and I try to run with localhost:8080/my-project but the error said "HTTP Status 404" .

If I remove the code and replace with code html, it's working. So the problem is my project cannot be run if in my code have php code.

Can anyone help me how to add library or setting in apache tomcat.

Apache Tomcat is a Java Servlet Container. This means, that it host Web-Applications written in Java and cannot run PHP scripts at all.

There are some projects, which brings a PHP script engine to Java, but as far as I know it is really uncommon.

Do you have a Java-part? If not, the tomcat is the wrong software for you.

The apache httpd will fit better for PHP

Like the previous comment says, maybe you misunderstood Apache Httpd with Apache Tomcat. Apache Httpd is a web server and with the "php module" activated could interpret php source. However if you need with PHP and JAVA together there its an Application Sever called Resin from the Cauchos's company using a module called Quercus what can do it. the link its this http://quercus.caucho.com/quercus-3.1/doc/quercus.xtp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM