Phprad | Classic

1. Prepare Production Environment # Create production database mysql -u root -p CREATE DATABASE blog_production; GRANT ALL ON blog_production.* TO 'app_user'@'localhost' IDENTIFIED BY 'strong_password'; Export development database mysqldump -u dev_user -p blog_development > database.sql Import to production mysql -u app_user -p blog_production < database.sql 2. Update Configuration // config.php - Production settings $config['db_host'] = 'localhost'; $config['db_user'] = 'app_user'; $config['db_password'] = 'strong_password'; $config['db_name'] = 'blog_production'; $config['debug_mode'] = false; $config['error_reporting'] = E_ALL & ~E_NOTICE & ~E_WARNING; 3. Secure File Permissions # Set proper ownership chown -R www-data:www-data /var/www/blog-admin/ chmod -R 755 /var/www/blog-admin/ chmod -R 770 /var/www/blog-admin/templates_c/ chmod -R 770 /var/www/blog-admin/uploads/ chmod 640 /var/www/blog-admin/config.php 4. Enable Production Cache // config.php $config['smarty_caching'] = true; $config['smarty_cache_lifetime'] = 86400; // 24 hours Troubleshooting Common Issues Problem: White screen after generation Solution: Enable error reporting

// config.php ini_set('display_errors', 1); error_reporting(E_ALL); Solution: Check permissions and paths phprad classic

Solution: Check session configuration

1. Modify .htaccess for Security # Deny access to sensitive directories RedirectMatch 403 ^/blog-admin/(classes|templates_c|includes)/.*$ Prevent directory listing Options -Indexes Protect config file <Files config.php> Order allow,deny Deny from all </Files> 2. Enable HTTPS Redirection // common.php - force HTTPS if (!isset($_SERVER['HTTPS']) || $_SERVER['HTTPS'] !== 'on') header("Location: https://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); exit(); Secure File Permissions # Set proper ownership chown

// Log the insertion $this->LogActivity("New post created: " . $this->title); Enable HTTPS Redirection // common

$sql = "SELECT * FROM posts WHERE views > :min_views"; return $this->ExecuteSQL($sql, array('min_views' => 100));

<!-- Custom HTML/PHP here --> <h2>Monthly Sales</h2> <?php // Your custom query $result = $DB->Execute("SELECT MONTH(publish_date) as month, COUNT(*) as count FROM posts GROUP BY MONTH(publish_date)"); ?>