Kurinchi Blogger Scribbles …

Posts Tagged ‘php.ini’

Apr 15

PHP SYSTEM WARNING: ‘date(): It is not safe to rely on the system’s timezone settings

Last updated: July 14th, 2015

Edit /etc/php.ini and add the timezone setting within the file. For a list of timezone settings, visit http://php.net/manual/en/timezones.php

; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = America/New_York

Aug 02

PHP: ‘Fatal error: Allowed memory size of 8388608 bytes exhausted’

Last updated: December 30th, 2010

Reason why you see this message is due to PHP memory leakage. PHP is trying to load a large image or file into memory and is not finding enough space for it to load.

If you think, that you will need the necessary feature to upload large files then there are two ways by which you can enable this feature.

i) Edit the physical file and have the line

ii) Edit php.ini and add the following line. You need to restart the apache/IIS server once php.ini file is modified.

Oct 09

PHP: What is PEAR?

Last updated: November 11th, 2009

PEAR stands for PHP Extension and Application Repository.

To learn more about the PEAR library click here

If you are beginner, the following link will help you tread with the library usage PEAR Manual

Installation instructions clearly walks through the steps for PEAR configuration. There may be cases where you may want to use PEAR libraries for specific projects only in which case you can install PEAR library for that specific purpose. To use it in projects, PEAR path should be set in php.ini settings or should be included in the project configuration’s physical path.

Aug 31

PHP removing deprecated related errors from display

Last updated: September 2nd, 2009

To remove deprecated warning message displays when executing PHP programs, open php.ini file and ADD to it

error_reporting = E_ALL & ~E_DEPRECATED

This is the setting for the production environment where you would not like to display the deprecated function related errors.

Sample error message
Assigning the return value of new by reference is deprecated in nusoap.php on line 7381

Jul 16

How to turn off register_globals via php.ini?

Last updated: July 15th, 2009

It is always secured to turn OFF register_globals in PHP applications. Earlier, we have seen how to turn OFF register_globals setting via .htaccess file and in this blog we will use php.ini instead.

Using a text editor create a file called php.ini. This will be our first step.

Next, we need to add the following line of code in php.ini
register_globals = off

Upload php.ini file to the root folder where your application resides.

May 28

PHP: Fatal error: Maximum execution time of 30 seconds exceeded

Last updated: May 30th, 2009

This error happens when the execution time of the PHP script exceeds the time limit for program execution in Php.ini file.

By default the timer is set to 30 seconds in php.ini and you can track the time limit by tracing for ‘max_execution_time’ directive in php.ini.

A quick way to find the execution time set for PHP is to check the phpinfo() function.

You can set the time limit by issuing “set_time_limit(60);” statement to increase the time limit.

A better way would be trace where the bottlenecks are in the program to identify what causes the time lag. Possible causes may be

* Poorly structured queries
* Never ending iterations
* Read lock on files when they are opened by multiple sources etc.

Valid HTML 4.01 Strict  Valid HTML 4.01 Strict