views:

48

answers:

2

Hi everybody,

I am using Drush which is launching php in command line. I copied my initial php.ini in my local directory so that php is using the same configuration as if it was launched by the web server. When used with the web server, it works well. Unfortunately, when launched with the command line, PHP crashes when drush calls mysqli_fetch_array and/or mysqli_fetch_object while everything is fine when calling mysqli_fetch_row... I am using EasyPHP 5.2.10 under windows.

Error message: an unhandled win32 exception occurred in php.exe [5772]. Just-In_time debugging this exception failed with the following error: No installed debugger has Just-In_time debugging enabled. In Visual Studio, Just-In-Time debugging can be enabled from Tools/Options/Debugging/Just-In-Time.

As requested in the comments, here are the information about PHP and the MySQLi module. Remark: The Client API library version and the Cient API header version are different. However, they are the same when using the web server phpinfo()... Could this be the problem? It is however a fresh easyPHP install...Oo'.

php -v

PHP 5.2.10 (cli) (built: Jun 17 2009 16:16:57) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

php -i

phpinfo() PHP Version => 5.2.10

System => Windows NT APOLLON 5.1 build 2600 Build Date => Jun 17 2009 16:16:01 Configure Command => cscript /nologo configure.js "--enable-snapshot-build" "--enable-debug-pack" "--with-snapshot-template=d:\php-sdk\snap _5_2\vc6\x86\template" "--with-php-build=d:\php-sdk\snap_5_2\vc6\x86\php_build" "--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared " "--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared" Server API => Command Line Interface Virtual Directory Support => enabled Configuration File (php.ini) Path => C:\WINDOWS Loaded Configuration File => C:\Program Files\EasyPHP5.2.10\www\drush\php.ini Scan this dir for additional .ini files => (none) additional .ini files parsed => (none) PHP API => 20041225 PHP Extension => 20060613 Zend Extension => 220060519 Debug Build => no Thread Safety => enabled Zend Memory Manager => enabled IPv6 Support => enabled Registered PHP Streams => php, file, data, http, ftp, compress.zlib Registered Stream Socket Transports => tcp, udp Registered Stream Filters => convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert., consumed, zlib.

This program makes use of the Zend Scripting Language Engine: Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies


Configuration

PHP Core

Directive => Local Value => Master Value allow_call_time_pass_reference => Off => Off allow_url_fopen => On => On allow_url_include => Off => Off always_populate_raw_post_data => Off => Off arg_separator.input => & => & arg_separator.output => & => & asp_tags => Off => Off auto_append_file => no value => no value auto_globals_jit => On => On auto_prepend_file => no value => no value browscap => no value => no value default_charset => no value => no value default_mimetype => text/html => text/html define_syslog_variables => Off => Off disable_classes => no value => no value disable_functions => no value => no value display_errors => STDOUT => STDOUT display_startup_errors => On => On doc_root => no value => no value docref_ext => no value => no value docref_root => no value => no value enable_dl => On => On error_append_string => no value => no value error_log => no value => no value error_prepend_string => no value => no value error_reporting => 6143 => 6143 expose_php => On => On extension_dir => C:\Program Files\EasyPHP5.2.10\php\ext\ => C:\Program Files\EasyPHP5.2.10\php\ext\ file_uploads => On => On highlight.bg => #FFFFFF => #FFFFFF highlight.comment => #FF8000 => #FF8000 highlight.default => #0000BB => #0000BB highlight.html => #000000 => #000000 highlight.keyword => #007700 => #007700 highlight.string => #DD0000 => #DD0000 html_errors => Off => Off ignore_repeated_errors => Off => Off ignore_repeated_source => Off => Off ignore_user_abort => Off => Off implicit_flush => On => On include_path => .;C:\php5\pear => .;C:\php5\pear log_errors => On => On log_errors_max_len => 1024 => 1024 magic_quotes_gpc => Off => Off magic_quotes_runtime => Off => Off magic_quotes_sybase => Off => Off mail.force_extra_parameters => no value => no value max_execution_time => 0 => 0 max_input_nesting_level => 64 => 64 max_input_time => -1 => -1 memory_limit => 128M => 128M open_basedir => no value => no value output_buffering => 0 => 0 output_handler => no value => no value post_max_size => 8M => 8M precision => 14 => 14 realpath_cache_size => 16K => 16K realpath_cache_ttl => 120 => 120 register_argc_argv => On => On register_globals => Off => Off register_long_arrays => Off => Off report_memleaks => On => On report_zend_debug => Off => Off safe_mode => Off => Off safe_mode_exec_dir => no value => no value safe_mode_gid => Off => Off safe_mode_include_dir => no value => no value sendmail_from => no value => no value sendmail_path => no value => no value serialize_precision => 100 => 100 short_open_tag => Off => Off SMTP => localhost => localhost smtp_port => 25 => 25 sql.safe_mode => Off => Off track_errors => On => On unserialize_callback_func => no value => no value upload_max_filesize => 2M => 2M upload_tmp_dir => ${path}\tmp\ => ${path}\tmp\ user_dir => no value => no value variables_order => GPCS => GPCS xmlrpc_error_number => 0 => 0 xmlrpc_errors => Off => Off y2k_compliance => On => On zend.ze1_compatibility_mode => Off => Off

[Skipped]

mysqli

MysqlI Support => enabled Client API library version => 5.1.42 Client API header version => 5.0.51a MYSQLI_SOCKET => /tmp/mysql.sock

Directive => Local Value => Master Value mysqli.default_host => no value => no value mysqli.default_port => 3306 => 3306 mysqli.default_pw => no value => no value mysqli.default_socket => no value => no value mysqli.default_user => no value => no value mysqli.max_links => Unlimited => Unlimited mysqli.reconnect => Off => Off

Any idea?

Regards.

+1  A: 

Probably an extension compatibility problem. Either the module was not compiled for your version of PHP or it's corrupt/missing.

I've seen this happen with other LAMP stacks when the command-line PHP interpreter isn't finding the correct extension directory.

infamouse
Oh, I see. How could I find which module is not correct and how could I correct this issue then? Thanks for your help!
Korchkidu
A: 

Hi,

I finally found my problem thanks to all your comments and answers that put me on the right track. The version of MyQSLi was ok when working with the web server but not with the command line. I noticed this when doing php -i as suggested. So, to correct this problem, you should download the files here and put them in your PHP \EXT directory to replace the old ones.

Best regards.

Korchkidu