How can I find the php.ini file used by the command line?
Just run php --ini
and look for Loaded Configuration File in the output for the location of php.ini
used by your CLI.
How can I know which 'php.ini' file is used?
You can use php_ini_loaded_file().
Taken from php.net:
$inipath = php_ini_loaded_file();
if ($inipath) {
echo 'Loaded php.ini: ' . $inipath;
} else {
echo 'A php.ini file is not loaded';
}
You may also want to check php_ini_scanned_files().
Also, you should note that if you run a PHP script from CLI, it's possible that a different php.ini
file will be used than if a server (e.g., nginx or Apache) runs it.
Other options:
php -i|grep 'php.ini'
- create
info.php
that contains<?php phpinfo();
in the webroot, and run it in your browser
where php.ini of is located in laravel applications?
You can use phpinfo()
function to check where the php.ini
file is located at:
<?php
phpinfo();
Or simply run php artisan tinker
in the terminal where the laravel project is and then run phpinfo()
in same terminal.
Then, look for Configuration File (php.ini) Path
in the output of phpinfo()
.
Where is php.ini?
Run this code (and I am assuming your php is running, you are not able to just locate the php.ini file)
<?php
phpinfo();
?>
And check the location of the config file:
Cannot locate my php ini file on live server?
enter in your server comand line: php -i
to see all of your php's config and also in very first lines of this command output, location of your php.ini if you can't find file like php.ini
in your output which may not happen make one with touch
command and put your configuration in that file and reload server, depend on what you use (like fpm or ...).
edit php configuration (php.ini) in wamp
maybe your system $PATH contains php 7.4 folder
but maybe wamp is using another version
to get the right php.ini:
- click once on wamp icon in the windows taskbar
- hover php to display
- php details click on php.ini on the little menu
the following image describe the process wamp php.ini file
how to access php.ini and set file_upload directive to on
Php.ini is system file located at remote web server and it contains global configuration for PHP. Only privileged users can edit php.ini.
You can change local configuration for your script using function ini_set
, for example:
ini_set('max_exection_time', 60);
According to phpinfo()
you sent, you already have file_uploads
set to On. So you don't need to edit anything. Just open link you sent, press CTRL+F and search for file_uploads
.
By the way, WinSCP is only application used to transfer files to remote web server using FTP/SFTP or similar protocols. Actually your web server is running on RHEL Apache 2.4.6. Just see section SERVER_SOFTWARE
in your phpinfo.
Related Topics
Highlight Row When the Checkbox Is True
What's Better At Freeing Memory With PHP: Unset() or $Var = Null
How to Store Repeating Dates Keeping in Mind Daylight Savings Time
Generating Random Results by Weight in PHP
Giving My Function Access to Outside Variable
How to Encrypt/Decrypt Data in PHP
How to Get a Hex Dump of a String in PHP
Form Inside of $.Load Not Posting Correctly
Https and Ssl3_Get_Server_Certificate:Certificate Verify Failed, Ca Is Ok
Failed to Connect to Mailserver At "Localhost" Port 25
Send JavaScript Variable to PHP Variable