PHP Fatal error: Class 'Redis' not found #108

Closed
almoorthi opened this Issue Dec 20, 2011 · 4 comments

Comments

Projects
None yet
3 participants

Hi,
I've installed latest phpredis and followed all steps properly, when i run simple script it's giving error
root@rd-vm:~# php -r '$redis = new Redis();'
PHP Fatal error: Class 'Redis' not found in Command line code on line 1

OUTPUT of nm

nm /usr/lib/php5/20090626/redis.so | grep " U "
U OnUpdateBool
U __assert_fail@@GLIBC_2.2.5
U __ctype_b_loc@@GLIBC_2.3
U __fprintf_chk@@GLIBC_2.3.4
U __stack_chk_fail@@GLIBC_2.4
U _array_init
U _convert_to_string
U _ecalloc
U _efree
U _emalloc
U _erealloc
U _estrdup
U _estrndup
U _object_init_ex
U _php_math_number_format
U _php_stream_eof
U _php_stream_free
U _php_stream_get_line
U _php_stream_read
U _php_stream_set_option
U _php_stream_write
U _php_stream_xport_create
U _zend_get_parameters_array
U _zend_hash_add_or_update
U _zend_hash_index_update_or_next_insert
U _zend_hash_init
U _zend_list_delete
U _zend_list_find
U _zval_copy_ctor_func
U _zval_dtor_func
U _zval_ptr_dtor
U add_assoc_bool_ex
U add_assoc_double_ex
U add_assoc_long_ex
U add_assoc_string_ex
U add_assoc_stringl_ex
U add_assoc_zval_ex
U add_next_index_bool
U add_next_index_double
U add_next_index_long
U add_next_index_null
U add_next_index_stringl
U add_next_index_zval
U add_property_resource_ex
U basic_globals
U call_user_function
U call_user_function_ex
U calloc@@GLIBC_2.2.5
U compiler_globals
U convert_to_long
U core_globals
U display_ini_entries
U executor_globals
U exit@@GLIBC_2.2.5
U free@@GLIBC_2.2.5
U gc_remove_zval_from_buffer
U malloc@@GLIBC_2.2.5
U memcpy@@GLIBC_2.2.5
U memset@@GLIBC_2.2.5
U php_add_session_var
U php_error_docref0
U php_info_print_table_end
U php_info_print_table_header
U php_info_print_table_row
U php_info_print_table_start
U php_lookup_class_name
U php_session_create_id
U php_session_register_module
U php_session_register_serializer
U php_set_session_var
U php_sprintf
U php_store_class_name
U php_url_free
U php_url_parse_ex
U php_var_serialize
U php_var_unserialize
U ps_globals
U sapi_module
U setsockopt@@GLIBC_2.2.5
U spprintf
U stderr@@GLIBC_2.2.5
U strchr@@GLIBC_2.2.5
U strcmp@@GLIBC_2.2.5
U strlen@@GLIBC_2.2.5
U strncasecmp@@GLIBC_2.2.5
U strtod@@GLIBC_2.2.5
U strtol@@GLIBC_2.2.5
U strtoll@@GLIBC_2.2.5
U var_destroy
U zend_declare_class_constant_stringl
U zend_error
U zend_exception_get_default
U zend_get_class_entry
U zend_get_object_classname
U zend_hash_destroy
U zend_hash_exists
U zend_hash_find
U zend_hash_get_current_data_ex
U zend_hash_get_current_key_ex
U zend_hash_get_current_key_type_ex
U zend_hash_index_find
U zend_hash_internal_pointer_reset_ex
U zend_hash_move_forward_ex
U zend_hash_num_elements
U zend_ini_boolean_displayer_cb
U zend_ini_long
U zend_list_insert
U zend_lookup_class
U zend_mangle_property_name
U zend_parse_method_parameters
U zend_parse_parameters
U zend_register_ini_entries
U zend_register_internal_class
U zend_register_internal_class_ex
U zend_register_list_destructors_ex
U zend_strndup
U zend_throw_exception
U zend_throw_exception_ex
U zend_unregister_ini_entries
U zend_wrong_param_count
U zval_used_for_init
php version is 5.3.2
uname output is
Linux rd-vm 2.6.32-33-generic #70-Ubuntu SMP Thu Jul 7 21:13:52 UTC 2011 x86_64 GNU/Linux
this line added in redis.ini
cat /etc/php5/conf.d/redis.ini
; redis extension
extention=/usr/lib/php5/20090626/redis.so

still not working,

php-config output
Usage: /usr/bin/php-config [OPTION]
Options:
--prefix [/usr]
--includes [-I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib ]
--ldflags []
--libs [-lcrypt -lz -lcrypt -lssl -ldb -lbz2 -lz -lpcre -lssl -lrt -lm -ldl -lnsl -lxml2 -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lxml2 -lxml2 -lxml2 -lcrypt -lxml2 -lxml2 -lxml2 -lxml2 -lcrypt ]
--extension-dir [/usr/lib/php5/20090626]
--include-dir [/usr/include/php5]
--php-binary [/usr/bin/php]
--php-sapis [cli apache2handler]
--phpapi [20090626]
--configure-options [--prefix=/usr --with-apxs2=/usr/bin/apxs2 --with-config-file-path=/etc/php5/apache2 --with-config-file-scan-dir=/etc/php5/apache2/conf.d --build=x86_64-linux-gnu --host=x86_64-linux-gnu --sysconfdir=/etc --mandir=/usr/share/man --disable-debug --with-regex=php --disable-rpath --disable-static --with-pic --with-layout=GNU --with-pear=/usr/share/php --enable-calendar --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-bcmath --with-bz2 --enable-ctype --with-db4 --without-gdbm --with-iconv --enable-exif --enable-ftp --with-gettext --enable-mbstring --with-pcre-regex=/usr --enable-shmop --enable-sockets --enable-wddx --with-libxml-dir=/usr --with-zlib --with-kerberos=/usr --with-openssl=/usr --enable-soap --enable-zip --with-mhash=yes --with-exec-dir=/usr/lib/php5/libexec --with-system-tzdata --without-mm --with-curl=shared,/usr --with-enchant=shared,/usr --with-zlib-dir=/usr --with-gd=shared,/usr --enable-gd-native-ttf --with-gmp=shared,/usr --with-jpeg-dir=shared,/usr --with-xpm-dir=shared,/usr/X11R6 --with-png-dir=shared,/usr --with-freetype-dir=shared,/usr --enable-intl=shared --with-ttf=shared,/usr --with-t1lib=shared,/usr --with-ldap=shared,/usr --with-ldap-sasl=/usr --with-mysql=shared,/usr --with-mysqli=shared,/usr/bin/mysql_config --with-pspell=shared,/usr --with-unixODBC=shared,/usr --with-recode=shared,/usr --with-xsl=shared,/usr --with-snmp=shared,/usr --with-sqlite=shared,/usr --with-sqlite3=shared,/usr --with-mssql=shared,/usr --with-tidy=shared,/usr --with-xmlrpc=shared --with-pgsql=shared,/usr]
--version [5.3.2-1ubuntu4.11]
--vernum [50302]

providing ldd /usr/lib/php5/20090626/redis.so output
linux-vdso.so.1 => (0x00007fffccfff000)
libc.so.6 => /lib/libc.so.6 (0x00007f7caaacd000)
/lib64/ld-linux-x86-64.so.2 (0x00007f7cab08f000)

chobie commented Dec 20, 2011

hmm, probably your redis.ini looks weird.

NO: extention=/usr/lib/php5/20090626/redis.so
OK: extension=/usr/lib/php5/20090626/redis.so
Contributor

nicolasff commented Dec 20, 2011

Thanks @chobie, that must be the issue.

@nicolasff nicolasff closed this Dec 20, 2011

thanks so much it's solved, and very sorry for spell mistake and i didn't even notice that also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment