Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Changes to php.ini not reflected in PHP's phpinfo()

Tags:

php

php-ini

xampp

I just can't get php_info() values to change on my localhost setup, or the related phpMyAdmin maximum file size.

So I have located the PHP file that phpinfo states is being loaded. I have changed the three parameters:

upload_max_filesize

post_max_size

memory_limit

Saved the file, restarted Apache and MySQL, reloaded the phpinfo() page... no changes.

I've also tried putting a .htaccess file in the web root folder with changes to these parameters. This is reflected in phpinfo in the local value (the master value still says 2M for maximum upload size), and then when I go to phpMyAdmin the maximum upload size is still 2M...

I've looked for a php.ini file in C://windows as this is where phpinfo() states the master value is derived from. But there isn't any php.ini file there. So I created one with the values I wanted... no success!

How can I fix this?

like image 396
Jimme Avatar asked Jan 13 '16 17:01

Jimme


People also ask

Is phpinfo hard to get working?

If there’s a problem beginners face with phpinfo it’s not that it’s hard to get working. It’s that it’s an incredibly large amount of information, much of which will make little or no sense.

Why are php files called “initialization files”?

Wikipedia tells us that the prefix came from a shortened version of “initialization”. In any case, that convention pervades PHP. These files are all pretty similar. They’ll have a number of values set in lines that are going to look pretty familiar to any programmer, like:

How do I change the PHP version of my website?

Changes made to the php.ini file will not take effect until you restart the server. If you're running MAMP or similar local hosting software, you might need to edit a php.ini template file rather than the loaded php.ini file. In MAMP on a Mac, for example, go to File → Edit template → PHP (php.ini) → [your php version].

What does the fifth line in the PHP configuration file mean?

However, the fifth line in matters a lot: it’s tells you which configuration file PHP loaded, in our case it’s the one at /etc/php5/fpm/php.ini. (The line is labelled: “Loaded Configuration File.”) Why is that useful?


2 Answers

I came across the same issue.

Check if php-fpm is running by this command:

ps aux | grep php-fpm

php-fpm stands for "FastCGI Process Manager" for PHP and it was probably built in your system. If so, you have to restart it. Assuming you are on a Linux system type:

  1. For Red Hat Linux, CentOS, Fedora, etc.

    sudo systemctl restart php-fpm.service
    
  2. For Debian-based systems (like Ubuntu)

    sudo service php-fpm restart
    

    or

    sudo service php7.0-fpm restart
    
like image 69
Nikos Gkikas Avatar answered Oct 12 '22 18:10

Nikos Gkikas


Don't do what I did... I changed max_input_vars from 1000 to 10000 but never noticed that the line was commented out by default.

; max_input_vars = 10000

I couldn't figure out why the value displayed in phpinfo() wouldn't change.

Doh!

like image 2
Wilson Logan Avatar answered Oct 12 '22 17:10

Wilson Logan