开发者

Configuration file in PHP installation

开发者 https://www.devze.com 2023-04-03 14:59 出处:网络
I am using the following command to check for configuration file for PHP installation. $ php --ini But when I press enter, it is showing no output. It just comes to a new line without showing anyth

I am using the following command to check for configuration file for PHP installation.

$ php --ini

But when I press enter, it is showing no output. It just comes to a new line without showing anything. Ple开发者_如何转开发ase help me in finding which configuration file is used by my PHP installation.

Configuration file in PHP installation

Basically, I am following the method shown in this link for verifying my PEAR installation.


That should work - it works on my PHP 5.2.19/win32 installation - and I don't know why it isn't working for you, but you can get the same info by either:

  • Creating a php script which contains this line - <?php phpinfo(); ?> - and loading it in a browser. This will show you a lot of information about your PHP installation, including information about the INI file(s) in use.
  • Running php -i from the command line - this will give you the same information as phpinfo() through the terminal. This may not work, if php --ini is not working. You could grep the output for instances of ini, e.g. php --i | grep ini

Something else that might be worth a try is redirecting the output of php --ini to a file, e.g. php --ini > phpini.txt.

Which PHP version are you running?


Try this, should output all your php info, configuration files included:

php -i |grep ".ini"


Use php_ini_loaded_file().

php -r "echo php_ini_loaded_file();"


Normally this should give you the configuration for your php. It looks like your php doesn't recognise the --ini parameter. Pass a php -h and look if --ini is supported by your installation.

What actually happens, your php is now waiting for input from you. Therefor it goes into the new line and waits for input.

What can also be, your system has set some default parameters for php by an alias. Call directly

/usr/bin/php --ini

maybe this helps. You can check if something is set by using

alias


create a file

<?php
  echo phpinfo();
?>

save as phpinfo.php

run file in shell php phpinfo.php

or open in browser for nicer view.

0

精彩评论

暂无评论...
验证码 换一张
取 消