Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change php.ini setting in laravel [duplicate]

Tags:

php

laravel

HI I want to change some of php.ini setting like post_max_size and upload_max_filesize I ran php.info() and found the correct php.ini file I changed it and reset the wamp then I ran php.info() again and I saw that the setting wasn't applied ,so how can I change php.ini setting in laravel? P.S: I wanted to upload a large file in laravel and I ran in to this problem

like image 310
Mohammad Reza Avatar asked Aug 17 '16 08:08

Mohammad Reza


1 Answers

There are 2 mistakes people make when amending the php.ini file in WAMPServer

Updating the wrong file.

See this post for a correct method of editing the right file

Editing the wrong piece of the php.ini file

At the top of the file are a lot of comments intended to help people understand what most of the parameters do. Do not edit these comments. Instead search again for the parameter you want to change it should appear again later in the file.

post_max_size = 8M

Is on line 660 (or there abouts depending on version)

upload_max_filesize = "16M"

Is on line 810 (or there abouts depending on version)

Final Note: Remember that the post_max_size must be > that the upload_max_filesize because the uploaded files are part of the POST payload but you need to include space in the post_max_size for the other fields on a form as well as the file(s)

Additional checks

If the above is not the issue then :-

Do you have a php.ini in the wrong place. Check your boot drive for any other php.ini file. There shoud be no php.ini files outside the \wamp\ folder. There is lots af bad advice out there and some suggest to put the php.ini file in the \windows or \windows\system32 folders. If you find any other delete them.

There is also bad advice out there suggesting that you add the PHP folder to your system PATH. If you have anything to do with WAMPServer on your PATH remove it.

like image 190
RiggsFolly Avatar answered Sep 20 '22 00:09

RiggsFolly