On CentOS7 VM, with PHP5.4.16 / Apache 2.4.6 / mariadb 5.5.44, the smarty template directory was not writable to generate compiled template files and gave the following error (in / var / log / httpd / error_log):
[Thu Mar 31 12:36:08.201383 2016] [:error] [pid 13094] [client 192.168.212.65:52204] PHP Fatal error: Smarty error: unable to write to $compile_dir '/var/www/html/app1/templates_c'. Be sure $compile_dir is writable by the web server user. in /var/www/html/app1/libs/smarty/Smarty.class.php on line 1093
therefore, the PHP application displayed a blank screen.
chmod 777 templates_c did not work either; but as per @Question Overflow's suggestion, the web root permission on this virtual machine resolved the issue.
I had to do:
[root@appserver html]
Of course, templates_c and cache should belong to apache user:
drwxr-xr-x. 2 apache apache 6 Mar 31 12:56 templates_c drwxr-xr-x. 2 apache apache 6 Mar 31 12:56 cache
After spending more than noon, I came across this. Thanks
NBhat Mar 31 '16 at 7:52 2016-03-31 07:52
source share