Magento Forum

Need help with changing max upload limit and post size- using php5cgi, php.ini configuration file
 
neuromancer
Jr. Member
 
Avatar
Total Posts:  24
Joined:  2007-11-20
 

After hours of trying to find the solution myself, I am turning to the forums for some help. Hopefully someone knows the answer to this.

Heres the rundown.

I installed magento using the php5cgi install.
Seeing as the php files are using magento’s php5 file to run the site, its not using the servers php.ini file for the configuration.

I have been looking in the sites directory and have no idea where it is pulling the php settings from. From the phpinfo() call it says

Server API CGI
Virtual Directory Support disabled
Configuration File (php.ini) Path /etc/php5cgi
Loaded Configuration File (none)
PHP API 20041225
PHP Extension 20060613
Zend Extension 220060519

I looked on the servers root /etc. the sites /etc directory and do not find this configuration file. Does anyone know where I can find it. I need to change the max_upload and max_post size so I can upload some downloadable items to sell.

Any help is appreciated.

Thanks!

Ben

 
Magento Community Magento Community
Magento Community
Magento Community
 
skippybosco
Moderator
 
Avatar
Total Posts:  796
Joined:  2008-10-03
 

Depending on your server configuration you can set this via your PHP.INI or your .htaccess:

In the root of your Magento installation add (or edit if it exists) a file called php.ini and add the following to it (modified to the values you require):

upload_max_filesize 20M
post_max_size 
40M

-or-

If your server relies on these being changed via .htaccess:

In the rot of your Magento installation add (or edit if it exists) a file called .htaccess and add the following to it (modified to the values you require)

php_value upload_max_filesize 20M
php_value post_max_size 40M
 
Magento Community Magento Community
Magento Community
Magento Community
 
WebhostUK LTD
Sr. Member
 
Avatar
Total Posts:  163
Joined:  2009-08-27
UK
 

Hello,

You can search the working php.ini file on the server by login to SSH as root and just type the command :

php -i |grep php.ini

it will show you the path of php.ini thats been used by your server.

You can edit that php.ini and increase the limit.

 
Magento Community Magento Community
Magento Community
Magento Community
 
neuromancer
Jr. Member
 
Avatar
Total Posts:  24
Joined:  2007-11-20
 

Hi

WebhostUK LTD, I did try what you mentioned beforehand, the problem is that this site is using its own cgi handler to run php. It doesnt use the servers php.ini configurations. It looks like its using something from the cgi-handler.
Instructions for this setup are here http://www.magentocommerce.com/knowledge-base/entry/installing-magento-on-a-php4-server

My problem is that I dont know where its pulling these php.ini configurations from. I am starting to think they are in the php-cgi binary file, but Im not sure. I also made a php.ini file in the root of the magento site, along with the cgi-bin/ directory where the php5-cgi file is located. Still no luck. I also put in the php_values in the .htaccess file. Still no luck.

I am wondering if there is a command in the .htaccess file to refer it to a specific php.ini file.

Any other suggestions?

Thanks,

Ben

 
Magento Community Magento Community
Magento Community
Magento Community
 
skippybosco
Moderator
 
Avatar
Total Posts:  796
Joined:  2008-10-03
 

Who is your host? Send them a support email and ask.. may be a shorter solution than trying to reverse engineer their configuration yourself.

 
Magento Community Magento Community
Magento Community
Magento Community
 
neuromancer
Jr. Member
 
Avatar
Total Posts:  24
Joined:  2007-11-20
 

Hi Skippybosco,

I went ahead and just upgraded my server php to php5. It worked fine. I think it was faster than trying to figure out the php5-cgi mess. I run my own servers and run them for my customers.

Thanks for the help smile

Ben

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top