如何在php文件中更改php.ini设置

i am installing vtiger6 in clients server. I don't have access to php.ini file. I have tried to change some php.ini setting throught my index.php file some settings works fine

ini_set('max_execution_time', 600);
ini_set('log_errors','off');

but i am not able to setup the following

ini_set('error_reporting','E_WARNING ^ E_NOTICE ^ E_DEPRECATED');
ini_set('allow_call_time_pass_reference','1');

and also i need to change the following too i don't know whether this is right or not

ini_set('max_file_uploads',300);
ini_set('memory_limit','240M');
ini_set('max_input_time ',600);

any help will be greatly appreciated.

The reason why error_reporting did not is, you set it's value to the following string. 'E_WARNING ^ E_NOTICE ^ E_DEPRECATED'. But it should not be a string. E_* values are PHP constants and should be used outside quotes like:

ini_set('error_reporting',E_WARNING ^ E_NOTICE ^ E_DEPRECATED);

Also you are using binary XOR (^) between these constants, which is unusual. Suggested value for production environments it is suggested to use E_ALL alone, for debugging. If you want all errors except E_DEPRECATED, you can use E_ALL & ~E_DEPRECATED

Some PHP settings cannot be changed with ini_set. You can check PHP documentation for which variables allow setting on file level. For example, max_file_uploads is only changable from php.ini (documentation)

set error_reporting by using function error_reporting. go through php.net manual

http://www.php.net/manual/en/function.error-reporting.php

for allow_call_time_pass_reference Entry can be set in php.ini, httpd.conf

you can create a php.ini file in your directory on server and store settings there.

use error_reporting instead of ini_set like error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);

use this in your .htaccess file that is existing in root folder php_value post_max_size 30M php_value upload_max_filesize 30M

that should work

Not all configuration in php.ini can be change on runtime with ini_set(). You can only set allow_call_time_pass_reference, max_file_uploads, memory_limit, and max_input_time in your php.ini.

But, if you want to show error you have to use both ini_set('display_errors') and ERROR_REPORTING(E_ALL)

ini_set('display_errors', '1');
ERROR_REPORTING(E_ALL);

References: