WordPress database error: [Can't open file: 'wp_comments.MYI' (errno: 144)]
SELECT ID, COUNT( comment_ID ) AS ccount FROM wp_posts LEFT JOIN wp_comments ON ( comment_post_ID = ID AND comment_approved = '1') WHERE ID IN (77) GROUP BY ID

Putting PHP Code into a Static HTML page :: Dave Smith’s SEO from England
  Dave Smith Home | Dave's SEO Services | About Dave Smith | Email me

Putting PHP Code into a Static HTML page

Often you have an old site built with .htm pages that just can’t use PHP code on it because the server wont run PHP on a static HTML page. I’ve struggled with this over and over - do I use Iframes, do I use JavaScript (Can do both but not great for search engines).

Finally today I have found out that as long as you are on an Apache server and can create or modify an .htaccess file then you can put PHP code into your static HTML page.

Here’s the code that goes into your .htaccess file at the web root (same directory as your homepage):

AddType application/x-httpd-php .htm

*Replace .htm with .html if your pages are named with .html extensions.

Once you’ve done that, test it out. Stick something like this in the code of your HTML page:

< ?php echo ("PHP is ON"); ?>

If that works then PHP is ON will be displayed wherever you inserted the code on your live page.

The reason I wanted to put PHP into my static HTML pages is that many of those old pages are well indexed in search engines. If I changed my old pages to php pages I would inevitably take a dive in most search engines until the new pages were indexed. I wanted easy ways to update my pages and using little PHP menus and inserts all over the page would help me do site-wide updates very quickly. I have been persevering with Dreamweaver templates, updating the site then uploading the entire thing by ftp onto the server but it is a slow and cumbersome process. Once you can add PHP into your static HTML pages you can do site-wide updates by changing just one file, or one line in a database.

WordPress database error: [Can't open file: 'wp_comments.MYI' (errno: 144)]
SELECT * FROM wp_comments WHERE comment_post_ID = '77' AND comment_approved = '1' ORDER BY comment_date

Leave a Reply