PHP Configuration - Locating and Editing php.ini (Apache, Nginx, PHP FPM)
HTML-код
- Опубликовано: 1 июл 2024
- PHP’s initialization file (php.ini) is responsible for configuring PHP. In this video we'll learn how to identify which php.ini file your system is using so you can make setting changes. This is done via the phpinfo function.Then, we’ll learn how to get your system to recognize any changes to your php.ini file by either restarting your server or reloading your PHP Handler.
Server types covered:
+ A local server running Apache via XAMPP
+ A live server running Apache
+ A live server running Nginx with the FPM / FastCGI PHP handler
The specific settings we’ll update in the php.ini file include upload_max_filesize and post_max_size. Both of these settings are often updated when you build a site that allows file uploads.
=== NOTES ===
codewithsusan.com/notes/php-c...
=== CHAPTERS ===
00:00 Introduction
00:15 Locate php.ini file with phpinfo()
01:45 Opening php.ini and working within it
03:00 Examples: upload_max_filesize and post_max_size
04:00 Making changes take effect on Apache server
05:05 Example with Nginx server with PHP FPM FastCGI handler
09:00 Recap
=== PRODUCTS I USE ===
Microphone: amzn.to/3ZRPdvb
Microphone windscreen: amzn.to/3ZRPdvb
(I may receive a small commission from sales associated with the above links. Any income from these sales goes directly to supporting new videos for this channel)
Thanks
Thanks for this video
Great video!
Another way of getting the loaded .ini file: php -I | grep "Loaded Configuration File" :)
Good tip! Just note that shows you the config file used by PHP running in command line which may be different than the PHP running on your web server.
thanks you very very much
thank you
you are amazig
nice video
Thanks for the video. It's quite useful. I have tried to do the same with the upload_tmp_dir by specifying /tmp as value in the php.ini (Apache, Nginx, PHP FPM), however phpinfo() keeps returning no value. Any hint on how to proceed?
Hi Johny - Which server type are you running? If you try changing another setting - for example the upload_max_filesize like I did in the video - are you seeing changes to that setting reflected in the phpinfo output after restarting?
@@codewithsusan Linux FPM/FastCGI. I could specify the upload_max_filesize and other non SYSTEM INI parameters without problem. Only upload_tmp_dir did not work as expected. I specified as /tmp as value for upload_max_filesize in the php.ini, however phpinfo kept returning null as value. It gave me quite a headache and I gave up and decided to use the system temporary dir, which is /tmp, in my php scripts. Thanks for the reply.
you just save my ass thank u very much
Glad to hear it! : )
Thanks