Can't load Memcache library in LAMPP [closed] - php

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I've spent last couple of hours trying to add the Memcache extension to my PHP (on LAMPP, using Ubuntu 11.10 amd64).
I followed this to tutorial (and some others), always I had errors:
Warnings on step-5:
configure.in:3: warning: prefer named diversions
configure.in:3: warning: prefer named diversions
Warning on step 7:
XAMPP: Stopping Apache...
Warning: PHP Startup: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/memcache.so' - /opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/memcache.so: wrong ELF class: ELFCLASS64 in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/memcache.so' - /opt/lampp/lib/php/extensions/no-debug-non-zts-20090626/memcache.so: wrong ELF class: ELFCLASS64 in Unknown on line 0
XAMPP: Starting Apache...
Can anyone please help me solve this issue? I haven't been able to find any solution to this problem which worked for me. Thanks for your time.
The commands are as given:
Edit:
Command that led to first 2 warnings (ran both the commands inside the memcache folder which was created on extracting the tar folder via the tar -xzf command):
/opt/lampp/bin/phpize
Command which led to the second 2 warnings:
/opt/lampp/lampp restartapache

I followed the tutorial about Installing memcached on ubuntu 10.04 and was able to set up memcache on my machine. After setting it up, I used
sudo /etc/init.d/memcached restart ; sudo /etc/init.d/apache2 restart
command to load both services (apache and memcache). You may see this tutorial as well.
I put my pages at the location /var/www.

Related

PHP startup issue on Ubuntu 18.04 [duplicate]

This question already has answers here:
PHP Startup Unable to load dynamic library /usr/lib/php/20151012/php_mysqli.dll
(10 answers)
Closed 3 years ago.
I'm running Ubuntu 18.04 with Apache and PHP 7.2. Everything works fine. My queries are working fine, but now and then I get error report with following description
PHP Startup: Unable to load dynamic library 'mysqli' (tried: /usr/lib/php/20170718/mysqli (/usr/lib/php/20170718/mysqli: cannot open shared object file: No such file or directory), /usr/lib/php/20170718/mysqli.so (/usr/lib/php/20170718/mysqli.so: undefined symbol: mysqlnd_global_stats))
I tried to search for it in php.ini but I can't find the problem. I tried to google it, but I can't find the same problem.
Does anyone have any idea what is causing it and how can I stop it?
Result from grep
You don't have php-mysql installed. To install that, open terminal and run this command:
sudo apt install php-mysql
after that you need to restart apache:
sudo service apache2 restart
You can check whether mysqli installed or not with this command line:
php -i | grep mysqli
I had the same problem, I solved changing php.ini
from:
extension=mysqli
to:
;extension=mysqli
because all mysqli settings already are here:
/etc/php/7.2/cli/conf.d/20-mysqli.ini

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/msqli.so'

Looked at all the articles on search for this and no answers that work -- on Ubuntu 16.04 I'm getting:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/msqli.so' - /usr/lib/php/20151012/msqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
msqli.so is definitely there in the folder cited above and is owned by root and is excutable. Folder and parent folders are owned by root. Hell of it is, phpmyadmin is running fine and can see and operate on the mySQL databases just fine. Do I need to chown folders/files to mysql or php entities? Just reinstalled Apache/php/mysql today and that did not fix it - all latest versions. Trying to use Eclipse IDE but this code fails on web server, too. Also tried in php.ini extensions pdo_msql.so and msqlnd.so and related coding techniques, but they all resulted in messages like the above (but with appropriate .so filename) so I suspect its 'environmental' something wrong in setup. phpinfo(); suggests the drivers are all there and working.
It seems that uninstalling all versions of php with
sudo apt-get purge `dpkg -l | grep php | awk '{print $2}' | tr "\n" " "`
and only installing the latest version with
apt install php libapache2-mod-php php-mysql php-xml php-soap php-gd php-mbstring
solved the problem for me.
Solved it with help from this post.
Changed php.ini:
extension=/usr/lib/php/20151012/mysqli.so
extension=/usr/lib/php/20151012/mysqlnd.so
to
extension=/usr/lib/php/20151012/mysqlnd.so
extension=/usr/lib/php/20151012/mysqli.so
ie: reversed the order of the 2 entries to put mysqlnd.so first.
Now I am all happy and telecomputing with alacrity and enthusiasm.

PHP modules don't load after installing PHP 7 to my server

I installed PHP 7 to my server (as a result, I have not /etc/php5 and /etc/php/7.0). When I run my web app, I cant see any of my previous CURL (or fork).
at first I got this err msg:
Message: Call to undefined function curl_init()
and after installing php7-curl i get it enabled - approved on info() function and this test code:
var_dump(_isCurl());
function _isCurl(){
return function_exists('curl_version');
}
returning TRUE.
but when having an actual CURL in my code I get this error:
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib/php/20151012/php_curl.dll' -
/usr/lib/php/20151012/php_curl.dll: cannot open shared object file: No
such file or directory in Unknown on line 0
in /usr/lib/php/20151012/ i have only .so files which doesn't make sense. (same goes for the /usr/lib/php5/20131226 folder). So what is it trying to get and why from there?
how can I configure my new php.ini file to get the previous model settings? (if possible with the enabled PCNTL_FORK too) How can I make it work with curl? what the hell happened???
EDIT 04.05.2016:
Ok, i decided to change it to curl.so and now got this msg PHP Warning: Module 'curl' already loaded in Unknown on line 0 and then I disabled it, and somehow, curl now is working (commented curl ;extension:curl.so and ;extension:php_curl.dll.
What the hell.
I had this exact problem.
I have just spent the last few hours trying to fix some stuff and in my haste I for some reason enabled this line:
extension:php_curl.dll
Obviously, that makes 0 sense, as someone said but the error message is weird after you do that. Running apt-get dist-upgrade DID NOT solve the problem.
So, after pulling out some more hair and re-reading this post a 100 times,
I just commented it back out
;extension:php_curl.dll
and ya, problem solved.
So the OP must have done what I did... drink beer while working
running apt-get dist-upgrade fixed all the problems :)
On my case, to get curl working :
sudo apt-get install php-curl
comment curl extension : ;extension=php_curl.dll in php.ini (eg /etc/php/7.1/cli/php.ini)
Settings might get mixed up when two versions of PHP being installed at the same time -- for example, 7.0 and 7.3. This can be because a recent dist-upgrade. The wrong version of the module might get loaded. In my case, apt purge php7.0 and a reinstall of 7.3 fixed me up, of course you might not want to be as heavy-handed with your own system...

Cassandra PHP libcassandra.so.2: cannot open shared object file

So I have spent the best part of the day trying (and failing) to get the php driver for apache cassandra to install on my server (CentOS 7).
After a lot of mucking about and a few grey hairs i have finally got the driver to install but unfortunately it doesnt actually load.
In my apache Error log i get
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/cassandra.so' - libcassandra.so.2: cannot open shared object file: No such file or directory in Unknown on line 0
I have checked and the libcassandra.so.2 file does indeed exist in /usr/local/lib64/libcassandra.
Has anyone come across a similar ptoblem?
Any help would be appreciated.
Im Running CentOS 7 and PHP 5.4.16 and Apache 2.4.6
Thanks
Matt.
the problem i was having was that libcassandra was installed into /usr/local/lib64 not /usr/lib64
a simple ln -s /usr/local/lib64/libcassandra.so.2 /usr/lib64/libcassandra.so.2 command fixed the problem

Zend Server 8 PDO could not find driver via CLI

I installed Zend Server 8, and I need to run scripts that use MySQL via the command line.
I get this error when I run one of my CLI scripts:
PDOException
could not find driver
But everything works via http, problem only occurs in CLI. I know there is a different php.ini for the CLI. However, when i reference the php.ini that the server uses for http like this:
php -c/usr/local/zend/etc/php.ini my-script
I get this:
Warning: PHP Startup: Unable to load dynamic library
/usr/local/zend/lib/php_extensions/pdo.so' -
/usr/local/zend/lib/php_extensions/pdo.so:
cannot open shared object file:
No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library /usr/local/zend/lib/php_extensions/readline.so' - /usr/local/zend/lib/php_extensions/readline.so:
cannot open shared object file:
No such file or directory in Unknown on line 0
Fatal error: Class 'PDO' not found in /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php on line 155
I have no idea how to troubleshoot this. I use Ubuntu 14.04 if that makes a difference.
It might also be useful to say that I installed LAMP first like this:
sudo apt-get install lamp-server^ and then I installed Zend Server
Any suggestions?
Thank you.
I ended up just changing the php alias to the php that was installed by Zend Server like this:
alias php=/usr/local/zend/bin/php
This seems to work, but still looking for a better/proper solution.

Categories