Php.ini file is the configuration file. Any changes in php.ini file can affect the functionalities of php. It is read each time the php is initialized. By default, php.ini file is located in /user/local/lib directory on your server. Max_execution_time, shot_open_tag, memory_limit, allow_url_fopen, PHP_INI_SYSTEM, PHP_INI_ALL, PHP_INI_PERDIR are some of the modes present in a php.ini configuration file. It can be easily access by others . We can restrict this by .htaccess.
Example:
<FilesMatch "\.(js | jpeg | jpg)$">
Order allow, deny
Deny from All
Allow from env=REDIRECT_STATUS
</FilesMatch>
Where,
You can add any file type by type extension without '.' and each one is separate by '|' .
OR
<Files php.ini>
Order allow, deny
Deny from all
</Files>
Now your php.ini file is invisible to viewers.
Related Post:
Example:
<FilesMatch "\.(js | jpeg | jpg)$">
Order allow, deny
Deny from All
Allow from env=REDIRECT_STATUS
</FilesMatch>
Where,
You can add any file type by type extension without '.' and each one is separate by '|' .
OR
<Files php.ini>
Order allow, deny
Deny from all
</Files>
Now your php.ini file is invisible to viewers.
Related Post:
What is htaccess?
Restrict users to access pages from site using .htaccess
Compressing resource with gzip using .htaccess
How to create error document using .htaccess
How to add expires headers using .htaccess
How to add MIME types using .htaccess
How to enable SSI using .htaccess
How to force script to display as source code using .htaccess
How to enable or disable directory list using .htaccess
How to redirect urls using
How to redirect to www using .htaccess
How to enable short tag in php using .htaccess
How to access pages through one page in site using .htaccess
Restrict users to access pages from site using .htaccess
Compressing resource with gzip using .htaccess
How to create error document using .htaccess
How to add expires headers using .htaccess
How to add MIME types using .htaccess
How to enable SSI using .htaccess
How to force script to display as source code using .htaccess
How to enable or disable directory list using .htaccess
How to redirect urls using
How to redirect to www using .htaccess
How to enable short tag in php using .htaccess
How to access pages through one page in site using .htaccess