You are here:  » Errors With PHP 5.3

Support Forum



Errors With PHP 5.3

Submitted by mneylon on Thu, 2011-04-07 19:38 in

I'm getting a few errors when running scripts from the command line:

PHP Warning: Module 'mcrypt' already loaded in Unknown on line 0
Warning: Directive 'register_long_arrays' is deprecated in PHP 5.3 and greater in Unknown on line 0
Warning: Directive 'magic_quotes_gpc' is deprecated in PHP 5.3 and greater in Unknown on line 0

The scripts still run, but it would be nice not to get the error messages :)

Submitted by support on Fri, 2011-04-08 16:11

Hi,

It looks like the warnings are being generated by the cli (command line) version of PHP in response to old directives that remain in your php.ini.

As the warnings are being reported at line 0 they are being generated before PHP has even began to process the script, so unfortunately it wouldn't be possible to suppress them using an error_reporting() call. Instead, the only thing you would be able to do is modify php.ini (assuming that you have access) and change (or add) the error_reporting directive to:

error_reporting = E_ERROR

If you don't have access to your php.ini, I would first create a test script, for example test.php containing just:

<?php
  print "Hello, World";
?>

...run that from the command line, and assuming that the same warning messages are displayed contact your host with a copy of the messages and they should be able to correct php,ini so that it corresponds with the command line version of php installed on your server...

Hope this helps!

Cheers,
David.
--
PriceTapestry.com