If you’re on shared hosting using cPanel as the control panel, you’d probably has the same problem as mine. The ini_set function is disabled by the hosting company for security purposes. Yeah, I know it’s for security purposes, but if I have to use it, I have to use it.
So I’ve learned from others on how to enable it.
- Go to your public_html directory.
- Create an empty php.ini and place the following line into it, without the ini_set.
(Note: Best practice is to copy the line from your host server’s /usr/local/lib/php.ini and remove the function you want to enable)
disable_functions = allow_url_fopen, escapeshellarg, escapeshellcmd, ini_alter, popen, show_source
- Open or create your .htaccess at public_html level and enter the following line.
(Replace %user% with your account name)
Warning: Enabling any of the disabled functions may pose security risks to your website. Do it at your own risks. You’ve been warned. 😛