php.ini increase upload_max_file debian server putty - php

Debian-64 bit-6.0.3 ispcp
I have this on my server i want to increase upload_max_file i edited two php.ini files and reset the server but no changes, still same, should i move the php.ini into another directory or which php.ini should i edit, what is the proper directory of it ?
Additionly my purpose is to let users upload max 10mb pics on sql but it keeps saying max 2,048k even though i have edited php.ini files as 10M

With debian latest servers you have suhosin by default installed you might need to change the parameter in that, also check if you have set in .htaccess file, did you restarted the apache service after doing changes in php.ini, please check this link http://www.cyberciti.biz/faq/linux-unix-apache-increase-php-upload-limit/ it might be helpful.
Thanks & Regards,
Alok Thaker

First, from the command line run :
php -i
Then search for :
Loaded Configuration File => /path/to/your/php.ini
Tip, for easier searching you can pipe grep like that : php -i | grep "php.ini"
Then you can edit your php.ini by changing the upload_max_file variable

You should be able to see which php.ini file it is using by adding a phpinfo file and calling it with domain/path/to/file.php
File contents should be:
<?php
phpinfo();
?>

Related

PHP memory limit dont want to change

I'm trying to resize my memory limit by change the php.ini
But when I check using phpinfo() the result is this :
the memory limit still the same as default. I've restart MAMP and nothing changed.
I hope someone can help me to solve this. Thank you.
Check the config in phpinfo():
Configuration File (php.ini) Path => path
Loaded Configuration File => path
Is the path the same with the file you changed? Have you restart the apache?
Here is how it works:
Start MAMP PRO
Stop the server if it's running
Choose Menu -> File -> Edit Template -> PHP4 php.ini (If you want to change the memory limit for PHP5, then choose PHP5 php.ini)
The PHP ini file will be opened.
If a dialogue box pops up, read it and confirm with OK
Search (Command-F) for "memory_limit" (without quotes)
You should get the following line:
memory_limit = 8M ; Maximum amount of memory a script may consume (8M)
Now you can change the default value of 8M. For instance. into 32M or even more (like 128M)
Save (Command-S) your changes.
Close (Command-W) the file.
Start the Server.
Credits :
http://blog-en.mamp.info/2009/09/increase-php-memory-limit-with-mamp-pro.html
Most probably you're editing the wrong php.ini configuration file.
Check the Loaded Configuration File from phpinfo() output and make sure you're editing the correct php.ini configuration file.

Editing php.ini with MAMP 3.5 where is the right ini file?

I'm trying to edit my php.ini file to turn off short tags. Pretty standard.
phpinfo() tells me I am running PHP Version 5.6.10
I have edited 2 php.ini files so far, and neither has taken effect (yes, I restarted MAMP)
MAMP/conf/php5.6.10/php.ini
MAMP/bin/php/php5.6.10/conf/php.ini
Neither file changes the status of short tags
Can anyone direct me where/how to change my php.ini settings?
I really freaking miss WAMP. Whose bright idea was it to buy a Mac?!?
When you run phpinfo() you need to look for the value Loaded Configuration File. This tells you which php.ini file PHP is using in the context of the web server.
Aaannnnnnnnddddd I was being a dufus
I had been commenting the line out instead of changing to "Off"
as you version is 5.6.10, and supposed your apache2 server runing on ubuntu.
php.ini dir is
/etc/php5/apache2/php.ini
On my Mac, running MAMP I have a few locations that would contain the likely php.ini
So I edited the memory_limit to different values in the 2 suspected files,
to test which one effected the actual MAMP PHP INFO page details.
By doing that I was able to determine that this was the correct php.ini:
/Applications/MAMP/bin/php/php7.2.10/conf/php.ini

php.ini unable to change upload_max_filesize

I am developing php applications on Ubuntu 13.04 and when i am trying to change the upload_max_filesize setting:
$ sudo gedit /etc/php5/apache2/php.ini
and restart apache the values do not change in my phpinfo() they stay at the default values
This is the path mentioned in the phpinfo:
Loaded Configuration File /etc/php5/apache2/php.ini
Those values can be read from more than one location. You only show one location (and yes there is a phpinfo showing only one location but there are other elements in phpinfo hinting additional ini locations and to tell you the truth: the phpinfo does not show all inis).
So actually this depends on your configuration (which can greatly differ as you've got an open system) and the only thing we can say for sure is that you
a) edited the wrong file -or -
b) made a mistake while editing the right file.
To fix your issue, edit the right file.
To find the right file, learn about your systems PHP configuration.
To learn about your systems PHP configuration, start removing the ini and see what happens.
To learn about how it works in general - not specific to your system - you can easily consult the PHP manual:
Runtime Configuration Docs
Try to check if there is any syntax error in your php.ini, if there is any, it will not take the changes.
also make sure that your php.ini is writable
Or if you are on Linux (same will apply for windows, just different path), check the error log file with the command like this:
$ tail -n 100 /var/log/apache2/error.log
after restarting apache server
This will show you the line of the error and its cause in case of the syntax error in php.ini.
Check also "Scan this dir for additional .ini files" and "Additional .ini files parsed"

How to change PHP master value of memory_limit

I trying to change the php memory_limit master value but still cant make it.
in htaccess i put 'php_value memory_limit 1024M', it's only change the local value..
Any ideas to change the master value?
Update your php.ini file. If you are on shared hosting without access to it, then your only option is to set it locally.
If you want to change the master value, you'll need to find the php.ini file located on the server. Take a look at https://stackoverflow.com/a/2750582/254973 if you need help finding the file.
Simply edit the value within that php.ini file, and you should be good to go. Maybe a restart of the webserver depending on it's configuration.
This will more than likely require elevated/root access on your hosting server.
Check the location of your php.ini file
php -i | grep php.ini
Configuration File (php.ini) Path => /usr/lib/lib
Loaded Configuration File => /usr/lib/php.ini
Something like this and edit the file with your favorite editor:
notepad, vim, emacs, pico...
pico /usr/lib/php.ini
Search and change memory limit and restart apache.
Change the php ini
memory_limit = 128M
to what you want
I was searching all over the system for this value, it seems it's stored in
/etc/php/8.1/fpm/pool.d/www.conf
I tried to change the memory_limit in these files but didn't change anything:
/etc/php/8.1/apache2/php.ini
/etc/php/8.1/fpm/php.ini
/etc/php/8.1/cgi/php.ini
/etc/php/8.1/cli/php.ini
Don't forget to restart the php and webserver (nginx/apache etc.) service after editing.

php.ini not working in IIS?

I've set magic_quotes_gpc = Off in php.ini,but I see it's still On in phpinfo();
First of all, you must be sure you modified the right php.ini file : there can be many files called php.ini -- and only one is "the right one".
You can see which php.ini file is used in the output of phpinfo() : there should be an entry called Configuration File (php.ini) Path that indicates the directory in which php.ini is looked for, and an entry called Loaded Configuration File that indicates the full path+name of the php.ini file that's used.
Then : don't forget to restart the webserver, so the modifications to php.ini are taken into account (Not sure that's necessary with IIS, but as it's required with Apache, I suppose it cannot hurt with IIS)
If that doesn't change a thing : what if you try to modify another directive : is the modification taken into account ?
As an alternative, you can disable it from your script too:
// disable magic_quotes_runtime
if (get_magic_quotes_runtime())
{
#set_magic_quotes_runtime(0);
}
You can check the php.ini file that was loaded via the php_ini_loaded_file function. Restart your web server.
On my installation the c:\php\php.ini file was named php ini. So phpmyinfo() was not loading it, despite the PATH environment variable including C:\php\. (Check this in a DOS prompt with SET PATH).
So rename it to php.ini.
It was difficult to spot in Windows Explorer.

Categories