2

I get the following errors:

A PHP Error was encountered

Severity: Warning

Message: chmod() has been disabled for security reasons

Filename: drivers/Session_files_driver.php

Line Number: 191

Backtrace:

File: /home/almsa/public_html/library/application/controllers/Home.php Line: 23 Function: library

File: /home/almsa/public_html/library/index.php Line: 315 Function: require_once

But if I remove $this->load->library('session'); from my controller then the errors go. My controller has only that line.

the controller works fine on localhost but gets that error when I uploaded it to a live server.

Please help, Thank you !

3
  • 1
    Remove the chmod string from the disable_functions at php.ini* file Commented Feb 1, 2017 at 3:50
  • Or you can Ask your hosting provider to remove the string above if you don't have an access to the php.ini* file Commented Feb 1, 2017 at 3:50
  • Please try setting the Error Reporting in the site Global Configuration to System Default or to None, that should hide PHP Notices and Warnings. But it is not recommended. Commented Feb 1, 2017 at 3:55

3 Answers 3

1
  • Remove the chmod string from the disable_functions at php.ini* file
  • Ask your hosting provider to remove the string above if you don't
    have an access to the php.ini* file
  • Change hosting provider which allows the running of the chmod
    function.

Reference: http://www.2by2host.com/articles/php-errors-faq/disabled_chmod/

Sign up to request clarification or add additional context in comments.

7 Comments

What a coincidence, I am about to give the same answer. @dhruv jadia
yes, sir but I just did the comment it. no problem. solving a problem is the main part. Hope we did that.
Thank you both, please let me know if I can find the php.ini myself or should I talk to the server support team? I use Cpanel.
tell me hosting site?
seems I have no php.ini, according to inmotionhosting.com/support/website/php/…
|
1

Add to your controller the following constructor:

function __construct() {
parent::__construct();
$this->load->library('session');
}

Comments

0

If its still not running on live you need to check you config settings regarding sessions storage in CI 3

    $config['sess_driver'] = 'files';
    $config['sess_cookie_name'] = 'ci_session';
    $config['sess_expiration'] = 7200;
    $config['sess_save_path'] = NULL;   // Mainly check this item `sess_save_path`
    $config['sess_match_ip'] = FALSE;
    $config['sess_time_to_update'] = 300;
    $config['sess_regenerate_destroy'] = FALSE; 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.