Difference between revisions of "Misceallaneous apache or php issues"
(Created page with "<yambe:breadcrumb>Apache_web_server_configuration|Apache web server configuration</yambe:breadcrumb> =Misceallaneous apache or php issues= ==“date(): It is not safe to rely...") |
m |
||
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Apache web server configuration]] > [[Misceallaneous apache or php issues]] | |||
=“date(): It is not safe to rely on the system's timezone settings…” error= | |||
This error may come if same code is used on an upgraded system (latest OS, PHP, apache, etc.). To solve this edit /etc/php.ini and under [Date] set proper timezone. For example: | This error may come if same code is used on an upgraded system (latest OS, PHP, apache, etc.). To solve this edit /etc/php.ini and under [Date] set proper timezone. For example: | ||
Line 11: | Line 10: | ||
date.timezone = Asia/Kolkata | date.timezone = Asia/Kolkata | ||
</pre> | </pre> | ||
Learned from http://stackoverflow.com/questions/16765158/date-it-is-not-safe-to-rely-on-the-systems-timezone-settings | |||
=Solving apache (13) permission denied errors= | |||
If apache gets permission denied first check filesystem permissions on the folder using: | |||
<pre> | |||
su - apache -s /bin/bash | |||
cd <folder> | |||
cat index.html | |||
</pre> | |||
etc. If these things work fine then check apache configuration. Either one among filesystem or configuration is usually issue for access denied. Check both httpd.conf and .htaccess. Also check permission and ownership on .htaccess. The problem can also be with SELinux context. Either disable SELinux or set correct context using: | |||
<pre> | |||
chcon system_u:object_r:httpd_config_t:s0 /etc/httpd/conf/httpd.conf | |||
chcon -R system_u:object_r:httpd_sys_content_t:s0 /home/sbarjatiya/public_html | |||
</pre> | |||
Also some SELinux variables which control connection of apache to database, or reading of web server files from inside /home might need to be updated. | |||
=Apache allow all on CentOS 7.0= | |||
On CentOS 7.0 for configuring full access from everywhere for all types of requests and options, instead of | |||
<pre> | |||
Options all | |||
AllowOverride all | |||
Order allow,deny | |||
Allow from all | |||
</pre> | |||
use | |||
<pre> | |||
Require all granted | |||
</pre> | |||
[[Main Page|Home]] > [[CentOS]] > [[CentOS 6.x]] > [[Apache web server configuration]] > [[Misceallaneous apache or php issues]] |
Latest revision as of 07:27, 6 March 2022
Home > CentOS > CentOS 6.x > Apache web server configuration > Misceallaneous apache or php issues
“date(): It is not safe to rely on the system's timezone settings…” error
This error may come if same code is used on an upgraded system (latest OS, PHP, apache, etc.). To solve this edit /etc/php.ini and under [Date] set proper timezone. For example:
[Date] ; Defines the default timezone used by the date functions ; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone date.timezone = Asia/Kolkata
Learned from http://stackoverflow.com/questions/16765158/date-it-is-not-safe-to-rely-on-the-systems-timezone-settings
Solving apache (13) permission denied errors
If apache gets permission denied first check filesystem permissions on the folder using:
su - apache -s /bin/bash cd <folder> cat index.html
etc. If these things work fine then check apache configuration. Either one among filesystem or configuration is usually issue for access denied. Check both httpd.conf and .htaccess. Also check permission and ownership on .htaccess. The problem can also be with SELinux context. Either disable SELinux or set correct context using:
chcon system_u:object_r:httpd_config_t:s0 /etc/httpd/conf/httpd.conf chcon -R system_u:object_r:httpd_sys_content_t:s0 /home/sbarjatiya/public_html
Also some SELinux variables which control connection of apache to database, or reading of web server files from inside /home might need to be updated.
Apache allow all on CentOS 7.0
On CentOS 7.0 for configuring full access from everywhere for all types of requests and options, instead of
Options all AllowOverride all Order allow,deny Allow from all
use
Require all granted
Home > CentOS > CentOS 6.x > Apache web server configuration > Misceallaneous apache or php issues