简体   繁体   中英

PHP is not loading config file

I installed PHP 5.4.28 and PHP is not reading the config file, because I set ioncube in config file and when I put in shell "php -v" ioncube is not in response. But no directly, I can see ioncube in "php -v" only when i set file in argument "php -v -c /etc/php54.ini". In "php -r 'phpinfo();' | grep .ini" is correctly set "Configuration File (php.ini) Path => /etc/php54.ini". I dont know what is wrong.

Summary:

php -v

PHP 5.4.24 (cli) (built: Jan 28 2014 10:21:58)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies

php -c /etc/php54.ini -v

PHP 5.4.24 (cli) (built: Jan 28 2014 10:21:58)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
    with the ionCube PHP Loader v4.5.2, Copyright (c) 2002-2014, by ionCube Ltd.

php -r "phpinfo();" | grep .ini

**Configuration File (php.ini) Path => /etc/php54.ini**
Scan this dir for additional .ini files => (none)
Additional .ini files parsed => (none)
user_ini.cache_ttl => 300 => 300
user_ini.filename => .user.ini => .user.ini
Classes => AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, CallbackFilterIterator, DirectoryIterator, DomainException, EmptyIterator, FilesystemIterator, FilterIterator, GlobIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, MultipleIterator, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveCallbackFilterIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RecursiveTreeIterator, RegexIterator, RuntimeException, SplDoublyLinkedList, SplFileInfo, SplFileObject, SplFixedArray, SplHeap, SplMinHeap, SplMaxHeap, SplObjectStorage, SplPriorityQueue, SplQueue, SplStack, SplTempFileObject, UnderflowException, UnexpectedValueException

/etc/php54.ini seems to be a path, instead of a file when you do not supply it. In my case, for example I get this:

bf@desktop-bf:~$ php -r "phpinfo();" | grep .ini
Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM