I found a tutorial that requires you to recompile Tomcat with PHP-handling. Tedious task for a simple need of enabling PHP. Good thing, there's Quercus -- a 100% Java implementation of PHP 5. This means that it can be used with Tomcat.
What I did was, download Quercus 4.0.3 binary, then extracted file to a temporary location.
Now move the following files from the Quercus' temporary location,
- /WEB-INF/lib/inject-16.jar
- /WEB-INF/lib/javamail-141.jar
- /WEB-INF/lib/resin.jar
to your Red5 installation's /webapps/root/WEB-INF/lib/{here}. Create the /lib directory on Red5's /root/WEB-INF if needed.
Now, here's the part where you need to be cautious.
From Red5's /webapps/root/WEB-INF/ location, then open web.xml.
Add the following before the </web-app> tag.
<servlet>
<servlet-name>Quercus Servlet</servlet-name>
<servlet-class>com.caucho.quercus.servlet.QuercusServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Quercus Servlet</servlet-name>
<url-pattern>*.php</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.php</welcome-file>
</welcome-file-list>
Now, try creating a helloworld.php to test Quercus.
Make sure to restart your Red5.

