linux - Cant connect to mysql ssl with compiled php (ubuntu 12) -


i have been bashing head against wall couple of days now. cant figure out.

i run ubuntu 12 plesk 12 , apache 2.2.

i have compiled php 5.6.10 , php 5.6.11 these options:

./configure --prefix=/opt/php-5.6.11-apache --with-config-file-path=/opt/php-5.6.11-apache/etc --disable-debug --enable-roxen-zts --enable-short-tags --enable-magic-quotes --enable-sigchild --enable-libgcc --with-libdir=/lib/x86_64-linux-gnu --with-openssl --with-openssl-dir=/usr/bin --with-zlib --enable-bcmath --with-bz2 --enable-calendar --enable-ctype --with-curl=/usr/bin --with-cdb --enable-inifile --enable-flatfile --enable-dba --with-xsl --enable-dom --enable-exif --enable-filter --enable-ftp --with-gd --with-png-dir=/usr --with-jpeg-dir=/usr --enable-gd-native-ttf --with-freetype-dir=/usr --with-gettext --with-gmp --enable-hash --with-iconv --with-imap --with-imap-ssl --with-kerberos --with-ldap --enable-mbstring --enable-mbregex --enable-mbregex-backtrack --with-mcrypt=/usr --with-mhash --with-mysql --with-mysql-sock=/var/run/mysqld/mysqld.sock --with-mysqli=mysqlnd --with-pgsql --with-unixodbc=/usr --with-sqlite --with-sqlite3=/usr --enable-pdo --with-pdo-mysql=mysqlnd --with-pdo-pgsql --with-pdo-odbc=unixodbc,/usr --with-pdo-sqlite=/usr --enable-phar --enable-posix --enable-session --with-mm --enable-shmop --enable-soap --with-xmlrpc --enable-libxml --enable-sockets --with-pspell --with-enchant --enable-intl --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-tidy --enable-tokenizer --enable-wddx --enable-simplexml --enable-xml --enable-xmlreader --enable-xmlwriter --enable-zip --with-pear --with-pcre-regex --with-snmp --enable-json --enable-pcntl --enable-inline-optimization --enable-fileinfo --enable-zend-multibyte --enable-opcache --enable-cgi --with-apxs2=/usr/bin/apxs2 --disable-all

i have tried following:

./configure --prefix=/opt/php-5.6.10 --with-config-file-path=/opt/php-5.6.10/etc --disable-debug --enable-roxen-zts --enable-short-tags --enable-magic-quotes --enable-sigchild --enable-libgcc --with-libdir=/lib/x86_64-linux-gnu --with-openssl --with-zlib --enable-bcmath --with-bz2 --enable-calendar --enable-ctype --with-curl --with-cdb --enable-inifile --enable-flatfile --enable-dba --with-xsl --enable-dom --enable-exif --enable-filter --enable-ftp --with-gd --with-png-dir=/usr --with-jpeg-dir=/usr --enable-gd-native-ttf --with-freetype-dir=/usr --with-gettext --with-gmp --enable-hash --with-iconv --with-imap --with-imap-ssl --with-kerberos --with-ldap --enable-mbstring --enable-mbregex --enable-mbregex-backtrack --with-mcrypt --with-mhash --with-mysql --with-mysqli --with-pgsql --with-unixodbc=/usr --with-sqlite --with-sqlite3 --enable-pdo --with-pdo-mysql --with-pdo-pgsql --with-pdo-odbc=unixodbc,/usr --with-pdo-sqlite --enable-phar --enable-posix --enable-session --with-mm --enable-shmop --enable-soap --with-xmlrpc --enable-libxml --enable-sockets --with-pspell --with-enchant --enable-intl --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-tidy --enable-tokenizer --enable-wddx --enable-simplexml --enable-xml --enable-xmlreader --enable-xmlwriter --enable-zip --with-pear --with-pcre-regex --with-snmp --enable-json --enable-pcntl --enable-inline-optimization --enable-fileinfo --enable-zend-multibyte --enable-opcache --enable-cgi --disable-all


i cant connect mysql ssl php!

i following errors:

php warning: mysql_connect(): stream not support ssl/crypto in /xxxxx/test2.php on line 2
php warning: mysql_connect(): cannot connect mysql using ssl in /xxxxx/test2.php on line 2
php warning: mysql_connect(): [2002] (trying connect via unix:///var/run/mysqld/mysqld.sock) in /xxxxx/test2.php on line 2

my test2.php contains following:

<?php $link = mysql_connect("localhost","axxxx5","jxxxxxxxxse",false,mysql_client_ssl)          or die(mysql_error()); $res = mysql_query("show status 'ssl_cipher';",$link); print_r(mysql_fetch_row($res)); echo "finished."; ?> 

note: cant connect phpmyadmin ssl uses mysqli query instead of mysql_connect, not deprecated thing.

when run phpinfo, seems fine:

openssl support enabled
openssl library version openssl 1.0.1 14 mar 2012
openssl header version openssl 1.0.1 14 mar 2012

but when check php module (ubuntu package) console works:

php /xxx/test2.php

array ( [0] => ssl_cipher [1] => aes256-sha ) finished

what can fix this??

thanks alot guys!

so, turns out compiled openssl php module looking in wrong folders.

once pointed openssl right ones, worked!


Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -