Thursday, November 19, 2009

Wordpress in Tomcat

First download the latest version of the following

1. Tomcat
2. Wordpress
3. Get the latest version of the Quercus, an open source Java implementation of PHP 5 from http://quercus.caucho.com/
4. MySQL Java connector http://www.mysql.com/products/connector/

Steps to install Wordpress in tomcat

1. Extract tomcat
2. Extract Wordpress to tomcat's webapps directory
3. Extract WEB-INF folder from the quercus.war file and put them in tomcat's Wordpress directory
4. Extract mysql connector jar file to wordpress/WEB-INF/lib
5. Go to WEB-INF/web.xml. Check if the following exist



6. Modified the tomcat/conf/web.xml file to the following.



7. Open wordpress/wp-includes/formatting.php. Change the js_escape() function to:



function js_escape($text) {
$safe_text = wp_specialchars($text, 'double');
//$safe_text = preg_replace('/&#(x)?0*(?(1)27|39);?/i', "'", stripslashes($safe_text));
//$safe_text = preg_replace("/\r?\n/", "\\n", addslashes($safe_text));
//stripslashes($safe_text));
$safe_text = preg_replace("/\r/", "\n", addslashes($safe_text));
$safe_text = preg_replace("/\n/", "\n", addslashes($safe_text));
return apply_filters('js_escape', $safe_text, $text);
}



8. Follow http://codex.wordpress.org/Installing_WordPress#Famous_5-Minute_Install to install Wordpress

6 comments:

  1. Hello Sir,
    This is too good.
    I am so happy with this blog.
    This solved my problem.I was searching for same since 2-3 days.

    Thank :)

    ReplyDelete
  2. I am very happy that my notes help you. :)

    ReplyDelete
  3. you are amazing, i just started 10 minutes back and now i was able to start on my website. thanks a lot

    ReplyDelete
  4. I am happy to see this note still helping others after 4 years :)

    ReplyDelete
  5. Thompson - This is PHENOMENAL! You have saved the day for Java PHP integration.

    God bless you!

    ReplyDelete

Windows 7 - STOP 0x0000007B (0xFFFFF880009A97E8 0xFFFFFFFFC0000034 0x0000000000 0x0000000000)

If you encounter STOP 0x0000007B (0xFFFFF880009A97E8 0xFFFFFFFFC0000034 0x0000000000 0x0000000000) blue screen of death. This is very like...