Archived Forum Post

Index of archived forum posts

Question:

Use/install php extension for Linux fails

May 25 '16 at 03:27

I am getting grey hairs trying to use the chilkat.so php extension. It must be an error on my end, but I just can't find what I am doing wrong here.

I did extract ALL (I know dont need all there) files from chilkat-9.5.0-php-5.5-x86-linux.tar an placed them into my "/web/chil" folder, which I can access via http.

showExtDir.php shows this: /usr/local/apache/modules So I placed the chilkat_9_5_0.so in there via SFTP-Access.

I did look into the phpinfo.php and got the following results for my QNAP-NAS Device:

> PHP Version 5.5.31 Build Date  Mar 11
> 2016 04:33:33   Configure Command 
> './configure' '--disable-debug'
> '--prefix=/root/daily_build/4.2.0/Model/TS-459/../../NasMgmt/HTTP/php5'
> '--with-config-file-path=/etc/config/php.ini' '--with-config-file-scan-dir=/etc/config/php.d'
> '--enable-ftp=shared'
> '--enable-sockets=shared'
> '--with-gettext=shared'
> '--with-zlib=shared'
> '--with-jpeg-dir='
> '--with-png-dir=/opt/cross-project/x86/sys-root/usr'
> '--with-gd=shared'
> '--with-freetype-dir=/opt/cross-project/x86/sys-root/usr'
> '--enable-gd-native-ttf=shared'
> '--enable-mbstring=shared'
> '--with-openssl=shared,/opt/cross-project/x86/sys-root/usr'
> '--with-libxml-dir=/opt/cross-project/x86/sys-root/usr'
> '--enable-libxml=shared,/opt/cross-project/x86/sys-root/usr'
> '--enable-sqlite-utf8=shared'
> '--with-mysql=shared,mysqlnd'
> '--with-mcrypt=shared,/opt/cross-project/x86/sys-root/usr'
> '--enable-zend-multibyte=shared'
> '--with-iconv=shared,/opt/cross-project/x86/sys-root/usr'
> '--enable-exif=shared'
> '--with-pdo-mysql=shared,mysqlnd'
> '--enable-pdo=shared'
> '--with-pdo-sqlite=shared,/opt/cross-project/x86/sys-root/usr'
> '--with-sqlite=shared'
> '--with-curl=shared,/root/daily_build/4.2.0/Model/TS-459/../../SysUtil/curl-7.43.0'
> '--with-curlwrappers=shared,/root/daily_build/4.2.0/Model/TS-459/../../SysUtil/curl-7.43.0'
> '--with-xsl=shared,/opt/cross-project/x86/sys-root/usr'
> '--with-mysqli=shared,mysqlnd'
> '--enable-calendar=shared'
> '--enable-bcmath=shared'
> '--with-ldap=shared,/opt/cross-project/x86/sys-root/usr'
> '--with-imap=shared,/opt/cross-project/x86/sys-root/usr'
> '--with-imap-ssl=/opt/cross-project/x86/sys-root/usr'
> '--enable-dba=shared'
> '--enable-dbase=shared'
> '--enable-shmop=shared'
> '--enable-wddx=shared'
> '--enable-zip=shared'
> '--with-xmlrpc=shared'
> '--enable-soap=shared'
> '--with-mssql=shared,/root/daily_build/4.2.0/Model/TS-459/../../NasMgmt/HTTP/php_modules/php_mod_install/i386'
> '--enable-pcntl=shared'
> '--enable-mysqlnd=shared'
> '--enable-session=shared'
> '--with-sqlite3=shared' '--enable-fpm'
> '--with-fpm-user=httpdusr'
> '--with-fpm-group=administrators'  
> Server API  FPM/FastCGI   Virtual
> Directory Support  disabled  
> Configuration File (php.ini) Path 
> /etc/config/php.ini   Loaded
> Configuration File 
> /mnt/HDA_ROOT/.config/php.

That is why I did add under "/mnt/HDA_ROOT/.config/php.ini" the following in the [PHP]-Section:

[PHP]

extension = chilkat_9_5_0.so
extension_dir = /usr/local/apache/modules

Accessing the standard file "test.php" I only get HTTP 500 error via IE and an empty page via Firefox. I am able to place a echo "Hello" BEFORE $crypt = new CkCrypt2() and It show sup on screen. But nothing AFTER this call. I am asking for your help :( I got 2 different Accounts with Serials (one with still 1 year support!) here.

<?php

include("chilkat_9_5_0.php");

echo "hello";

$crypt = new CkCrypt2();

Accepted Answer

If you set enable_dl = on, then my guess is that the "... dl() is deprecated ..." error is just a warning. If it wasn't a warning, I would guess PHP wouldn't try to load the chilkat_9_5_0.so. However, we can see it is trying to load it, but does not find it at the directory "/share/MD0_DATA/Web/chil/chilkat_9_5_0.php". So the question is: Does "chilkat_9_5_0.php" not exist in the directory "/share/MD0_DATA/Web/chil"? If not, then put it there, and make sure the permissions on the .so are such that it can be opened and used by the loader..


Answer

I Googled "QNAP-NAS Device PHP extension" and found this page:

http://forum.qnap.com/viewtopic.php?t=5621

Two things jump out at me...

  1. Look at the apache_error_log to see what it says. (Go to the web page at the above URL to see the discussion.) Does the error log indicate "cannot open shared object file: No such file or direc..", or does it say "PHP Warning: PHP Startup: Invalid library (maybe not a PHP library) 'chilkat_9_5_0.so' in Unknown on line 0"?
  2. If the QNAP-NAS Device is an ARM-based device, then you would need the Chilkat PHP Extension for ARM Linux: https://www.chilkatsoft.com/php.asp#armLinuxDownloads (Maybe you were using the PHP Extension for x86 Linux?)

Answer

Also... if you have SSH shell access to the QNAP-NAS device, then see if you can run a simple PHP script that instantiates the CkCrypt object. In other words, eliminate Apache from the equation and see if you can first get something simpler to work. If you experience problems in the simpler case, then you can solve it first, and then move to the environment where the Apache web server is running the PHP..


Answer

Awesome help! It works. Thank you very much. I am sure this question & answer is going to help a lot of people getting it to work!