CHAPTER 10 SECURING (Make my own web site) AND MAINTAINING PHPBB 319

CHAPTER 10 SECURING AND MAINTAINING PHPBB 319 Extract template_file_cache.php from the /contrib folder from your phpBB installation package and place it in the /includes subdirectory. Remove the existing template.php file after ensuring it is backed up in a safe place, and rename template_file_cache.php to template.php. Next, you will need to upload the /cache subdirectory and its contents from your phpBB installation package to the server, and make it world-writable (777). As I discussed in Chapter 8, SmartFTP (http://www.smartftp.com) makes this task easy. Upload the newly christened template.php to your server (in the /includes subdirectory), and you will be finished. Visit a few pages on your board and take a look at the /cache subdirectory, and you should see some files inside, indicating caching is happening. Database Template Caching If you decide to go the database route, extract template_db_cache.php. Copy it over your existing template.phpfile (after making a backup of that file). In this case, you will not create a cache subdirectory, but rather a new table in your database. Log in to phpMyAdmin, select your phpBB database, and navigate to the SQL tab at the top. You ll be running another raw SQL query, shown in Listing 10-1, in this box. The represents whatever database prefix you are using on your server, which defaults to phpbb. Listing 10-1. The SQL Query to Run in phpMyAdmin to Create the New Caching Table CREATE TABLE _template_cache ( template_name char(255) NOT NULL default ‘’, template_handle char(50) NOT NULL default ‘’, template_cached int(11) NOT NULL default ‘0′, template_echo tinyint(1) NOT NULL default ‘1′, template_compile text NOT NULL, PRIMARY KEY (template_name) ) Tip You can find this same query in the README.html file located in the /contrib folder of your phpBB installation or upgrade package. It will be easier and less error-prone for you to copy and paste the query than for you to type it straight in. After creating the table, upload the enhanced template.php file to your includessubdirectory (as for the flat-file system). Visit a few pages of your phpBB, and open the template_cache table in your phpBB installation to ensure that there is activity in the table, indicating that the caching is working properly. Uninstalling Template Caching If, for some reason, you wish to uninstall the template cache system, simply copy the original template.php, either from your backup or the installation package, over the one that currently exists. This restores the old template functionality. Only then can you remove the /cachesubdirectory or the template cache table, as removing those prior to restoring the original noncaching file can cause errors.
We recommend high quality webhost to host and run your jsp application: christian web host services.

Leave a Reply