php-ini

ini_set() scope of effect?

痞子三分冷 提交于 2019-11-26 23:13:18
问题 I've had index.php and several files which cascading include,something like this. index.php -> controller.php -> model.php -> view.php In model.php I have a function using ini_set('memory_limit', '-1'); When will the ini_set() change of the setting expire? After executed index.php ? Or view.php ? Or the function in model.php ? 回答1: ini_set() is global for everything that happens in the script (not just the current file: the whole thread of execution that is occurring), for this entire one

Edit php.ini file

最后都变了- 提交于 2019-11-26 21:04:31
I want to increase memory_limit , max_input_time , max_execution_time in WAMP server. There is 3 php.ini files. 1. C:\wamp\bin\apache\Apache2.4.4\bin\php.ini<br> 2. C:\wamp\bin\php\php5.4.12\php.ini<br> 3. C:\wamp\bin\php\php5.4.12\phpForApache.ini<br> so Which php.ini file should be edit in WAMP server? The wampmanager icon, which sits in the system tray has a menu system. Use that to edit your php.ini file that is used with Apache. So its (left click ) wampmanager icon -> PHP -> php.ini It could not be simpler. EDIT/UPDATE: And now in WAMPServer 3 it has become even easier to change some of

PHP out of memory error even though memory_limit not reached

假如想象 提交于 2019-11-26 20:23:41
问题 I have just inherited a site with a PHP script that is consistently running out of memory at 117 MB. This happens even when I increase PHP's memory_limit variable to 312 MB, which I'm doing via php.ini. This is now solved thanks to a great clue from pcguru. See my answer below that begins: I have finally found the answer ini_get('memory_limit') returns the value set in php.ini, so I'm certain Apache has restarted after changing the value. I'm using memory_get_usage(true) to return the memory

Increase max execution time for php

流过昼夜 提交于 2019-11-26 19:21:01
I have added set_time_limit(0); function to increase execution time but its executing only 2-3 minutes maximum. error_reporting(E_ALL); error_reporting(1); set_time_limit(0); I want to search links from a site wich taking a long lime . Any help would be greatly appreciated. Thanks a lot. Sumith Harshan PHP file (for example, my_lengthy_script.php) ini_set('max_execution_time', 300); //300 seconds = 5 minutes .htaccess file <IfModule mod_php5.c> php_value max_execution_time 300 </IfModule> More configuration options <IfModule mod_php5.c> php_value post_max_size 5M php_value upload_max_filesize

where can I find the php.ini for php-cli

混江龙づ霸主 提交于 2019-11-26 17:35:32
It appears that the php command line is using a different php.ini from the main php interpreter. I am using Ubuntu 10.4. My problem is that in the main php.ini I have included an extra path for an external library, but in the cli version this is not present, and so I have a path inclusion error. thanks Just ask PHP: $ php -i |grep php\.ini Better yet: $ php --ini This will also show all extra *.ini files loaded (usually hanging around in some conf.d dir in debian): Configuration File (php.ini) Path: /etc/php5/cli Loaded Configuration File: /etc/php5/cli/php.ini Scan for additional .ini files

How to know which php.ini is used?

孤人 提交于 2019-11-26 15:34:14
问题 I search the path where the php.ini file is located in our Linux Ubuntu server, and I found many php.ini when executing the command find / -name php.ini . So how to know exactly from a php script web page where the php.ini is located ? 回答1: 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

Edit php.ini file

爱⌒轻易说出口 提交于 2019-11-26 07:47:54
问题 I want to increase memory_limit , max_input_time , max_execution_time in WAMP server. There is 3 php.ini files. 1. C:\\wamp\\bin\\apache\\Apache2.4.4\\bin\\php.ini<br> 2. C:\\wamp\\bin\\php\\php5.4.12\\php.ini<br> 3. C:\\wamp\\bin\\php\\php5.4.12\\phpForApache.ini<br> so Which php.ini file should be edit in WAMP server? 回答1: The wampmanager icon, which sits in the system tray has a menu system. Use that to edit your php.ini file that is used with Apache. So its (left click ) wampmanager icon

Set PDO to throw exceptions by default [duplicate]

假装没事ソ 提交于 2019-11-26 06:46:44
问题 This question already has an answer here : My PDO Statement doesn't work (1 answer) Closed 2 years ago . I always want PDO to throw exceptions if an error occurs, as I always use PDO like so: try { $dbh = new PDO(\"mysql:host=$kdbhost;dbname=$kdbname\",$kdbuser,$kdbpw); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // some queries } catch (PDOException $e) { error_log(\'PDO Exception: \'.$e->getMessage()); die(\'PDO says no.\'); } It would be nice if there was a config file I

where can I find the php.ini for php-cli

强颜欢笑 提交于 2019-11-26 05:30:22
问题 It appears that the php command line is using a different php.ini from the main php interpreter. I am using Ubuntu 10.4. My problem is that in the main php.ini I have included an extra path for an external library, but in the cli version this is not present, and so I have a path inclusion error. thanks 回答1: Just ask PHP: $ php -i |grep php\.ini 回答2: Better yet: $ php --ini This will also show all extra *.ini files loaded (usually hanging around in some conf.d dir in debian): Configuration

Dude, where&#39;s my php.ini?

让人想犯罪 __ 提交于 2019-11-25 23:43:25
问题 A few years ago I installed Apache 2.2x and PHP 5.3.1 on a Linux server I maintain. I used .tar.gz\'s and built them as instructed (instead of rpms and what-have-you). And all was fine. Today I need to install this which seems like a PHP library. I went through all the steps up to make install, and I find ibm_db2.so in $PHP_HOME/lib/extensions/somecomplicatedname/ibm_db2.so The great catch is the last step is to configure php.ini but there is NO php.ini on my system. Horror of horrors. PHP