skip to Main Content

How can add/edit my php.ini t define my own parameters? In cpanel on a shared server.php server in that case.

2

Answers


  1. Chosen as BEST ANSWER

    I got a good approach that can work on any server. I will give my scenario, you can change based on your environment.

    1.create .htacess file in the public_html and paste this

    <IfModule php5_module>
       php_flag asp_tags Off
       php_flag display_errors On
       php_value max_execution_time 300
       php_value max_input_time 600
       php_value max_input_vars 10000
       php_value memory_limit 8000M
       php_value session.gc_maxlifetime 1440
       php_value session.save_path "/var/cpanel/php/sessions/ea-php56"
       php_value upload_max_filesize 1000M
       always_populate_raw_post_data=-1 
    </IfModule>
    

    2. create user.ini file in the public_html and paste this

       asp_tags = Off
        display_errors = On
        max_execution_time = 300
        max_input_time = 600
        max_input_vars = 10000
        memory_limit = 8000M
        session.gc_maxlifetime = 1440
        session.save_path = "/var/cpanel/php/sessions/ea-php56"
        upload_max_filesize = 1000M
        always_populate_raw_post_data=-1 
    
    1. create php.ini file in the public_html and paste this

      allow_url_fopen = On
      allow_url_include = Off
      asp_tags = Off
      display_errors = On
      enable_dl = On
      file_uploads = On
      max_execution_time = 300
      max_input_time = 600
      max_input_vars = 10000
      memory_limit = 8000M
      session.gc_maxlifetime = 1440
      session.save_path = "/var/cpanel/php/sessions/ea-php56"
      upload_max_filesize = 1000M
      always_populate_raw_post_data=-1
      

    Done!!!!!!!! It worked for me !!!


  2. Edit your php.ini

    You really need WHM access – not cPanel (or extraneous, vulnerable hacks).

    Are you here because of another installer?

    For example, whilst experimenting with ways to approach the Matomo install, I recommend NOT using the standard installer. It may throw "always_populate_raw_post_data = -1", as it did for me.

    If you’re without WHM access, try Softaculous.

    Save time by updating to at least php7.1

    Matomo will be and running really quickly if that is why you need to edit php.ini.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search