# php56 throwing an error



## dpalme (Feb 20, 2016)

I have run into all kinds of problems lately, the latest being this:
`php`
results in the following:

```
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20131226/zlib.so' - Cannot open "/usr/local/lib/php/20131226/zlib.so" in Unknown on line 0
PHP Warning:  Module 'mysql' already loaded in Unknown on line 0
```

Any suggestion on how to fix this? Also when I try to access a wordpress site, it keeps telling me that its missing the mysql extension, I have deinstalled and reinstalled php56 twice now, including the extensions with no success....


----------



## dpalme (Feb 20, 2016)

Wow, 
Nobody has a suggestion on this?


----------



## dpalme (Feb 20, 2016)

Here is some additional info: I have deinstalled the port, a pkg info does not show a php56, php55, or any other.  It does show some of the following: php56-iconv, php56-json, etc.  when I run a php info page, it shows php installed.... where the heck is that coming from? Its almost like I have a ghost copy of it floating around....

however php from the command line does not execute... so I'm lost and dead at the moment


----------



## dpalme (Feb 21, 2016)

Ok this is really getting frustrating.  I have again deinstalled lang/php56, made sure the MySQL extension isn't installed and the php56 extensions are not installed.... yet it still will execute and display content from the phpinfo()

What am I missing here?


----------



## dpalme (Feb 21, 2016)

Not sure if this will help, but here is the output from the `phpinfo()`

```
System FreeBSD www 10.1-RELEASE-p9 FreeBSD 10.1-RELEASE-p9 #0: Tue Apr 7 01:09:46 UTC 2015 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64
Build Date Feb 15 2016 18:28:14
Configure Command './configure' '--with-layout=GNU' '--localstatedir=/var' '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all' '--enable-libxml' '--enable-mysqlnd' '--with-libxml-dir=/usr/local' '--with-pcre-regex=/usr/local' '--with-zlib-dir=/usr' '--program-prefix=' '--disable-cli' '--disable-cgi' '--with-apxs2=/usr/local/sbin/apxs' '--with-regex=php' '--with-zend-vm=CALL' '--enable-debug' '--prefix=/usr/local' '--mandir=/usr/local/man' '--infodir=/usr/local/info/' '--build=amd64-portbld-freebsd10.1' 'build_alias=amd64-portbld-freebsd10.1' 'CC=cc' 'CFLAGS=-pipe '-g' '-fstack-protector' '-fno-strict-aliasing'' 'LDFLAGS= '-fstack-protector'' 'LIBS=-lpthread' 'CPPFLAGS=' 'CPP=cpp' 'CXX=c++' 'CXXFLAGS=-pipe '-g' '-fstack-protector' '-fno-strict-aliasing'
Server API Apache 2.0 Handler
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/local/etc
Loaded Configuration File /usr/local/etc/php.ini
Scan this dir for additional .ini files /usr/local/etc/php
Additional .ini files parsed /usr/local/etc/php/extensions.ini
PHP API 20131106
PHP Extension 20131226
Zend Extension 220131226
Zend Extension Build API220131226,NTS,debug
PHP Extension Build API20131226,NTS,debug
Debug Build yes
Thread Safety disabled
Zend Signal Handling disabled
Zend Memory Manager enabled
Zend Multibyte Support disabled
IPv6 Support enabled
DTrace Support disabled
Registered PHP Streams php, file, glob, data, http, ftp, compress.zlib
Registered Stream Socket Transports tcp, udp, unix, udg
Registered Stream Filters string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, zlib.*
[ATTACH=full]2957[/ATTACH] This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
Configuration
apache2handler
Apache Version Apache/2.2.31 (FreeBSD) PHP/5.6.18 mod_ssl/2.2.31 OpenSSL/1.0.2f DAV/2
Apache API Version 20051115
Server Administrator webmaster@.org
Hostname:Port
User/Group www(80)/80
Max Requests Per Child: 10000 - Keep Alive: on - Max Per Connection: 100
Timeouts Connection: 300 - Keep-Alive: 5
Virtual Server Yes
Server Root /usr/local
Loaded Modules core prefork http_core mod_so mod_authn_file mod_authn_dbm mod_authn_anon mod_authn_default mod_authn_alias mod_authz_host mod_authz_groupfile mod_authz_user mod_authz_dbm mod_authz_owner mod_authz_default mod_auth_basic mod_auth_digest mod_file_cache mod_cache mod_disk_cache mod_dumpio mod_reqtimeout mod_include mod_filter mod_charset_lite mod_deflate mod_log_config mod_logio mod_env mod_mime_magic mod_cern_meta mod_expires mod_headers mod_usertrack mod_unique_id mod_setenvif mod_version mod_ssl mod_mime mod_dav mod_status mod_autoindex mod_asis mod_info mod_cgi mod_dav_fs mod_vhost_alias mod_negotiation mod_dir mod_imagemap mod_actions mod_speling mod_userdir mod_alias mod_rewrite mod_php5
Directive Local Value Master Value
engine 1 1
last_modified 0 0
xbithack 0 0
Apache Environment
Variable Value
UNIQUE_ID VsngQGw9L3MAAA@miF8AAAAE
HTTP_HOST
HTTP_USER_AGENT Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:44.0) Gecko/20100101 Firefox/44.0
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_LANGUAGE en-US,en;q=0.5
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_CONNECTION keep-alive
PATH /sbin:/bin:/usr/sbin:/usr/bin
SERVER_SIGNATURE no value
SERVER_SOFTWARE Apache/2.2.31 (FreeBSD) PHP/5.6.18 mod_ssl/2.2.31 OpenSSL/1.0.2f DAV/2
SERVER_NAME
SERVER_ADDR 118
SERVER_PORT 80
REMOTE_ADDR 
DOCUMENT_ROOT /home//www/data
SERVER_ADMIN webmaster@.org
SCRIPT_FILENAME /home/www/data/phpinfo.php
REMOTE_PORT 56292
GATEWAY_INTERFACE CGI/1.1
SERVER_PROTOCOL HTTP/1.1
REQUEST_METHOD GET
QUERY_STRING no value
REQUEST_URI /phpinfo.php
SCRIPT_NAME /phpinfo.php
HTTP Headers Information
HTTP Request Headers
HTTP Request GET /phpinfo.php HTTP/1.1
Host
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:44.0) Gecko/20100101 Firefox/44.0
Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language en-US,en;q=0.5
Accept-Encoding gzip, deflate
Connection keep-alive
HTTP Response Headers
X-Powered-By PHP/5.6.18
Core
PHP Version 5.6.18
Directive Local Value Master Value
allow_url_fopen On On
allow_url_include On On
always_populate_raw_post_data 0 0
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 UTF-8 UTF-8
default_mimetype text/html text/html
disable_classes no value no value
disable_functions no value no value
display_errors Off Off
display_startup_errors Off Off
doc_root no value no value
docref_ext no value no value
docref_root no value no value
enable_dl Off Off
enable_post_data_reading On On
error_append_string no value no value
error_log no value no value
error_prepend_string no value no value
error_reporting 22527 22527
exit_on_timeout Off Off
expose_php On On
extension_dir /usr/local/lib/php/20131226-debug /usr/local/lib/php/20131226-debug
file_uploads On On
highlight.comment #FF8000 #FF8000
highlight.default #0000BB #0000BB
highlight.html #000000 #000000
highlight.keyword #007700 #007700
highlight.string #DD0000 #DD0000
html_errors On On
ignore_repeated_errors Off Off
ignore_repeated_source Off Off
ignore_user_abort Off Off
implicit_flush Off Off
include_path .:/usr/local/share/pear .:/usr/local/share/pear
input_encoding no value no value
internal_encoding no value no value
log_errors On On
log_errors_max_len 1024 1024
mail.add_x_header On On
mail.force_extra_parameters no value no value
mail.log no value no value
max_execution_time 30 30
max_file_uploads 20 20
max_input_nesting_level 64 64
max_input_time 60 60
max_input_vars 1000 1000
memory_limit 500M 500M
open_basedir no value no value
output_buffering 4096 4096
output_encoding no value no value
output_handler no value no value
post_max_size 500M 500M
precision 14 14
realpath_cache_size 16K 16K
realpath_cache_ttl 120 120
register_argc_argv Off Off
report_memleaks On On
report_zend_debug On On
request_order GP GP
sendmail_from no value no value
sendmail_path /usr/sbin/sendmail -t -i  /usr/sbin/sendmail -t -i
serialize_precision 17 17
short_open_tag Off Off
SMTP localhost localhost
smtp_port 25 25
sql.safe_mode Off Off
sys_temp_dir no value no value
track_errors Off Off
unserialize_callback_func no value no value
upload_max_filesize 50M 50M
upload_tmp_dir no value no value
user_dir no value no value
user_ini.cache_ttl 300 300
user_ini.filename .user.ini .user.ini
variables_order GPCS GPCS
xmlrpc_error_number 0 0
xmlrpc_errors Off Off
zend.detect_unicode On On
zend.enable_gc On On
zend.multibyte Off Off
zend.script_encoding no value no value
date
date/time support enabled
"Olson" Timezone Database Version 2015.7
Timezone Database internal
Default timezone UTC
Directive Local Value Master Value
date.default_latitude 31.7667 31.7667
date.default_longitude 35.2333 35.2333
date.sunrise_zenith 90.583333 90.583333
date.sunset_zenith 90.583333 90.583333
date.timezone no value no value
ereg
Regex Library Bundled library enabled
libxml
libXML support active
libXML Compiled Version 2.9.3
libXML Loaded Version 20903
libXML streams enabled
mysqlnd
mysqlnd enabled
Version mysqlnd 5.0.11-dev - 20120503 - $Id: 76b08b24596e12d4553bd41fc93cccd5bac2fe7a $
Compression not supported
core SSL supported
extended SSL not supported
Command buffer size 4096
Read buffer size 32768
Read timeout 31536000
Collecting statistics Yes
Collecting memory statistics No
Tracing n/a
Loaded plugins mysqlnd,example,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password
API Extensions no value
mysqlnd statistics
bytes_sent 0
bytes_received 0
packets_sent 0
packets_received 0
protocol_overhead_in 0
protocol_overhead_out 0
bytes_received_ok_packet 0
bytes_received_eof_packet 0
bytes_received_rset_header_packet 0
bytes_received_rset_field_meta_packet 0
bytes_received_rset_row_packet 0
bytes_received_prepare_response_packet 0
bytes_received_change_user_packet 0
packets_sent_command 0
packets_received_ok 0
packets_received_eof 0
packets_received_rset_header 0
packets_received_rset_field_meta 0
packets_received_rset_row 0
packets_received_prepare_response 0
packets_received_change_user 0
result_set_queries 0
non_result_set_queries 0
no_index_used 0
bad_index_used 0
slow_queries 0
buffered_sets 0
unbuffered_sets 0
ps_buffered_sets 0
ps_unbuffered_sets 0
flushed_normal_sets 0
flushed_ps_sets 0
ps_prepared_never_executed 0
ps_prepared_once_executed 0
rows_fetched_from_server_normal 0
rows_fetched_from_server_ps 0
rows_buffered_from_client_normal 0
rows_buffered_from_client_ps 0
rows_fetched_from_client_normal_buffered 0
rows_fetched_from_client_normal_unbuffered 0
rows_fetched_from_client_ps_buffered 0
rows_fetched_from_client_ps_unbuffered 0
rows_fetched_from_client_ps_cursor 0
rows_affected_normal 0
rows_affected_ps 0
rows_skipped_normal 0
rows_skipped_ps 0
copy_on_write_saved 0
copy_on_write_performed 0
command_buffer_too_small 0
connect_success 0
connect_failure 0
connection_reused 0
reconnect 0
pconnect_success 0
active_connections 0
active_persistent_connections 0
explicit_close 0
implicit_close 0
disconnect_close 0
in_middle_of_command_close 0
explicit_free_result 0
implicit_free_result 0
explicit_stmt_close 0
implicit_stmt_close 0
mem_emalloc_count 0
mem_emalloc_amount 0
mem_ecalloc_count 0
mem_ecalloc_amount 0
mem_erealloc_count 0
mem_erealloc_amount 0
mem_efree_count 0
mem_efree_amount 0
mem_malloc_count 0
mem_malloc_amount 0
mem_calloc_count 0
mem_calloc_amount 0
mem_realloc_count 0
mem_realloc_amount 0
mem_free_count 0
mem_free_amount 0
mem_estrndup_count 0
mem_strndup_count 0
mem_estndup_count 0
mem_strdup_count 0
proto_text_fetched_null 0
proto_text_fetched_bit 0
proto_text_fetched_tinyint 0
proto_text_fetched_short 0
proto_text_fetched_int24 0
proto_text_fetched_int 0
proto_text_fetched_bigint 0
proto_text_fetched_decimal 0
proto_text_fetched_float 0
proto_text_fetched_double 0
proto_text_fetched_date 0
proto_text_fetched_year 0
proto_text_fetched_time 0
proto_text_fetched_datetime 0
proto_text_fetched_timestamp 0
proto_text_fetched_string 0
proto_text_fetched_blob 0
proto_text_fetched_enum 0
proto_text_fetched_set 0
proto_text_fetched_geometry 0
proto_text_fetched_other 0
proto_binary_fetched_null 0
proto_binary_fetched_bit 0
proto_binary_fetched_tinyint 0
proto_binary_fetched_short 0
proto_binary_fetched_int24 0
proto_binary_fetched_int 0
proto_binary_fetched_bigint 0
proto_binary_fetched_decimal 0
proto_binary_fetched_float 0
proto_binary_fetched_double 0
proto_binary_fetched_date 0
proto_binary_fetched_year 0
proto_binary_fetched_time 0
proto_binary_fetched_datetime 0
proto_binary_fetched_timestamp 0
proto_binary_fetched_string 0
proto_binary_fetched_json 0
proto_binary_fetched_blob 0
proto_binary_fetched_enum 0
proto_binary_fetched_set 0
proto_binary_fetched_geometry 0
proto_binary_fetched_other 0
init_command_executed_count 0
init_command_failed_count 0
com_quit 0
com_init_db 0
com_query 0
com_field_list 0
com_create_db 0
com_drop_db 0
com_refresh 0
com_shutdown 0
com_statistics 0
com_process_info 0
com_connect 0
com_process_kill 0
com_debug 0
com_ping 0
com_time 0
com_delayed_insert 0
com_change_user 0
com_binlog_dump 0
com_table_dump 0
com_connect_out 0
com_register_slave 0
com_stmt_prepare 0
com_stmt_execute 0
com_stmt_send_long_data 0
com_stmt_close 0
com_stmt_reset 0
com_stmt_set_option 0
com_stmt_fetch 0
com_deamon 0
bytes_received_real_data_normal 0
bytes_received_real_data_ps 0
example statistics
stat1 0
stat2 0
pcre
PCRE (Perl Compatible Regular Expressions) Support enabled
PCRE Library Version 8.37 2015-04-28
Directive Local Value Master Value
pcre.backtrack_limit 1000000 1000000
pcre.recursion_limit 100000 100000
Reflection
Reflection enabled
Version $Id: fbcf7a77ca8e3d4cd7501de8025235b947b8240f $
SPL
SPL support enabled
Interfaces Countable, OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject
Classes AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, CallbackFilterIterator, DirectoryIterator, DomainException, EmptyIterator, FilesystemIterator, FilterIterator, GlobIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, MultipleIterator, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveCallbackFilterIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RecursiveTreeIterator, RegexIterator, RuntimeException, SplDoublyLinkedList, SplFileInfo, SplFileObject, SplFixedArray, SplHeap, SplMinHeap, SplMaxHeap, SplObjectStorage, SplPriorityQueue, SplQueue, SplStack, SplTempFileObject, UnderflowException, UnexpectedValueException
standard
Dynamic Library Support enabled
Path to sendmail /usr/sbin/sendmail -t -i
Directive Local Value Master Value
assert.active 1 1
assert.bail 0 0
assert.callback no value no value
assert.quiet_eval 0 0
assert.warning 1 1
auto_detect_line_endings 0 0
default_socket_timeout 60 60
from no value no value
url_rewriter.tags a=href,area=href,frame=src,input=src,form=fakeentry a=href,area=href,frame=src,input=src,form=fakeentry
user_agent no value no value
zlib
ZLib Support enabled
Stream Wrapper compress.zlib://
Stream Filter zlib.inflate, zlib.deflate
Compiled Version 1.2.8
Linked Version 1.2.8
Directive Local Value Master Value
zlib.output_compression Off Off
zlib.output_compression_level -1 -1
zlib.output_handler no value no value
Additional Modules
Module Name
Environment
Variable Value
PATH /sbin:/bin:/usr/sbin:/usr/bin
LD_LIBRARY_PATH /usr/local/lib
PWD /
HOME /
RC_PID 17
PHP Variables
Variable Value
_SERVER["UNIQUE_ID"] VsngQGw9L3MAAA@miF8AAAAE
_SERVER["HTTP_HOST"]
_SERVER["HTTP_USER_AGENT"] Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:44.0) Gecko/20100101 Firefox/44.0
_SERVER["HTTP_ACCEPT"] text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
_SERVER["HTTP_ACCEPT_LANGUAGE"] en-US,en;q=0.5
_SERVER["HTTP_ACCEPT_ENCODING"] gzip, deflate
_SERVER["HTTP_CONNECTION"] keep-alive
_SERVER["PATH"] /sbin:/bin:/usr/sbin:/usr/bin
_SERVER["SERVER_SIGNATURE"] no value
_SERVER["SERVER_SOFTWARE"] Apache/2.2.31 (FreeBSD) PHP/5.6.18 mod_ssl/2.2.31 OpenSSL/1.0.2f DAV/2
_SERVER["SERVER_NAME"]
_SERVER["SERVER_ADDR"]
_SERVER["SERVER_PORT"] 80
_SERVER["REMOTE_ADDR"] 99.195.117.87
_SERVER["DOCUMENT_ROOT"] /home/www/data
_SERVER["SERVER_ADMIN"]
_SERVER["SCRIPT_FILENAME"] /home/www/data/phpinfo.php
_SERVER["REMOTE_PORT"] 56292
_SERVER["GATEWAY_INTERFACE"] CGI/1.1
_SERVER["SERVER_PROTOCOL"] HTTP/1.1
_SERVER["REQUEST_METHOD"] GET
_SERVER["QUERY_STRING"] no value
_SERVER["REQUEST_URI"] /phpinfo.php
_SERVER["SCRIPT_NAME"] /phpinfo.php
_SERVER["PHP_SELF"] /phpinfo.php
_SERVER["REQUEST_TIME_FLOAT"] 1456070720.645
_SERVER["REQUEST_TIME"] 1456070720
```


----------



## dpalme (Feb 22, 2016)

Any help on this would be greatly appreciated, I'm totally dead in the water at this point.


----------



## julp (Feb 22, 2016)

You've deinstalled lang/php56 but not www/mod_php56 and Apache wasn't restarted? Sure you built lang/php56 and www/mod_php56 with the exact same options (both with or without ZTS)?

What's the output of `pkg info -x php`?

What are your current issues? You still have an error with mysql and zlib extension? If so, have you checked the *.ini files under /usr/local/etc/php?


----------



## dpalme (Feb 22, 2016)

ok that was part of the problem, I needed to recompile `www/mod_php56`, so now I'm down to the following error:

PHP fatal error: Call to undefined function simplexml_load_string()

I deleted and reinstalled: `textproc/simplexml` and `textproc/php56-simplexml` but I'm still getting the same error.

I checked the `rmconfig` for `lang/php56-extensions` and simplexml was checked.

Suggestions?


----------



## julp (Feb 22, 2016)

Based on a previous thread (FAMP installation failure), if it's related to ZTS option, try (not tested) the following:

Add to /etc/make.conf:

```
.if ${.CURDIR:M*php56*}
WITHOUT_ZTS=YES # if you want ZTS, replace WITHOUT_ZTS by WITH_ZTS
.endif
```
Or run:

```
awk 'BEGIN { while (("pkg query -x %o \"/(mod_)?php56(-|$)\"" | tr / _" | getline name) > 0) { print name "_UNSET_FORCE=ZTS" } }' >> /etc/make.conf # same, if you want ZTS, replace _UNSET_ by _SET_
```

Then rebuild all *php56* port with `portmaster -r www/mod_php56`.

Notes:

textproc/simplexml is not related to textproc/php56-simplexml (if it was, it'll be automatically installed as dependency)
ZTS is not needed with default Apache's MPM (prefork)


----------



## dpalme (Feb 22, 2016)

I'll give it a whirl, I'm starting to think a package didn't install correctly during the last build and something caused a bunch to get out of wack


----------



## dpalme (Feb 23, 2016)

Ok that did the trick.  thanks for the help my friend!


----------

