PHP Cassandra module not working - php

I carefully read all Q&A here for about 2 days but could not resolve my issue, so please do not say that i should read something in first 20 strings of search.
My problem is:
I use Xubuntu, apache2 and php5. Cassandra itself installed and working, cassandra service is running, cassandra cpp installed.
Command
pecl install cassandra
works ok, physically cassandra.so exist. When i add extension=cassandra.so in php.ini Apache crashes on start.
When i try run
php -r " Cassandra::cluster()->build();"<br>
it returns:
PHP Fatal error: Class 'Cassandra' not found in Command line code on line 1
I try add extension that not exist in 'php.ini'(like extension = sdbcibsdbc.so) but it simply ignored, so problem is not in mistakes or something - cassandra.so makes crash. Also previous version(cassandra-1.0.0) simply ignored, not crash Apache but not work too.
What can it be?

I resolve issue, but details still unclear.
This situation, when you can install cassandra php driver but cant add into 'php.ini' means that some of C++ driver dependences not resolved, in my case it was libuv. Have no idea how it possible: libuv-dev without libuv and why pecl throw no errrors.
I remove libuv 1.8.0 and install 1.7.5 - and all OK! Then i try 1.8.0 again and it works too. So, probably i miss some step in installation process but it goes without errors or warnings.
As always, most problems will disappear with carefully reinstall.

After installing Cassandra you must add extension=cassandra.so to php.ini to enable it:
Build process completed successfully
Installing '/opt/rh/rh-php71/root/usr/lib64/php/modules/cassandra.so'
install ok: channel://pecl.php.net/cassandra-1.3.2
configuration option "php_ini" is not set to php.ini location
You should add "extension=cassandra.so" to php.ini

Related

PHP Startup : Unable to load dynamic library PGSQL

I'am trying to run Symfony 3.x with :
Ubuntu 16.04
PHP 7.0
NGinx
I would like to interact with my PGSQL database that I created but I get this error :
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib/php/20151012/php_pdo_pgsql.dll' -
/usr/lib/php/20151012/php_pdo_pgsql.dll: cannot open shared object
file: No such file or directory in Unknown on line 0
[Doctrine\DBAL\Exception\DriverException] An
exception occured in driver: could not find driver
[Doctrine\DBAL\Driver\PDOException] could not find driver
[PDOException] could not find driver
So I looked at my phpinfo() and it seems that pgsql driver is enabled
Can anyone help me on this one ?
You must properly install the PostgreSQL module and enable it. http://php.net/manual/en/pgsql.installation.php
P.S. do not use '.dll' files on the servers with UNIX based OS, because these extensions are compiled for the Windows operating system (for UNIX based OS you must use '.so' files).
I had a very similar issue:
I fixed it by applying the same patch as for this subject:
pdo_parse_params error in pdo_odbc.so whenever PHP starts in Fedora 20
In a nutshell: if a module has already been loaded by the /etc/php/7.2/mods-available/<module>.ini (or equivalent path for your OS), then the module should not be uncommented (= made active) in the php.ini files. (two of them, cli and server).
You may ensure this, by checking phpinfo(), and observe how pdo_pgsql is still active in there, despite the line being commented in php.ini!
For me, none of the above solutions worked. Uncommenting extension=pgsql in php.ini also didn't work in and of itself.
It seemed as if postgresql wasn't installed even though I had installed it on my Ubuntu using
sudo apt-get install postgresql-12
Finally, I realized I had to install:
sudo apt-get install php-pgsql
I had a similar problem and (after installing the PHP pg driver) I had to add two files to /etc/php.d
20-pgsql.ini
extension=pgsql.so
30-pdo-pgsql.ini
extension=pdo_pgsql.so
Putting these extension config lines in the php.ini kept giving me the pdo_parse_params error
The only solution that seemed to work for me was to comment out extension=pdo_pgsql and extension=pgsql inside /etc/php8.1/cli/php.ini by adding ; in front of the them:
;extension=pdo_pgsql
;extension=pgsql
This is for PHP version 8.1

PHP installation appears to be missing the MySQL extension which is required by WordPress. 4

My site keeps giving the error "Your PHP installation appears to be missing the MySQL extension which is required by WordPress."
I have rhel6 + php5.3.3 + php-mysql + wordpress + apache installed on one server. On a seperate server we have mysql + mysql-server installed.
In wp-config.php I configured our mysql server.
I have been seeking for solutions for over a day now but I cannot seem to fix it.
I tried adding/ uncommenting the extension=mysql.so & mysqli.so line in php.ini but that didn't do anything either.
The phpinfo.php page gives info back, only thing is that scan dir for additional ini's is not looking at the right dir. Don't know if that can cause this problem though.
Anyone an idea?
With kind regards,
Bram
I found out that an installation of PHP via yum install has a default config and disables a lot, like this config option --without-mysql.
I downloaded PHP from their site and compiled it myself with my own config and this worked.
I also found that this problem does not occure on CentOS7, a yum install of php, php components and mariadb works fine with wordpress.
Your PHP installation appears to be missing the MySQL extension which is required.
Only one thing causes that error. Your PHP.INI doesn't have the mysql line uncommented, so it's not loading the mysql module (or the module is simply missing entirely).
Restart your webserver after you fix the PHP.INI file.

Install Composer fails "openssl extension is missing" error

I've been trying to install Composer for about a month now on a Windows 10 computer. Every time I run the Windows OS installer, it gives me this error:
Some settings on your machine make Composer unable to work properly.
Make sure that you fix the issues listed below and run this script again:
The openssl extension is missing, which means that secure HTTPS transfers are impossible.
If possible you should enable it or recompile php with --with-openssl
I've checked in my php.ini file (C:\Bitnami\wampstack-5.4.39-0\php\php.ini) and it is not commented out. I've checked for the DLL itself in the ETC folder, it's there. I've restarted my Apache Web Server several times. Heck, I've reinstalled PHP and my WAMP Servers. Nothing is working. I've tried downloading a fresh Composer installer thinking maybe my original one got corrupted some how. Still doesn't work. Am I missing something here?
After about another week of research and talking with a University professor about it, I ultimately found that the issue stemmed from my Bitnami installation path. Installing the wampstack as it defaulted by the installer (wampstack-version#) seems to cause problems in composers ability to install. Make sure to install it without the version on the end of the wampstack path.

How to update PHP and install ICU library on CentOS 6.x

I'm trying to install orocrm on centos server and it is asking for PHP 5.4 and ICU library 4.4. Although I updated PHP and restarted Apache my php version still shows PHP 5.3 if outputting phpinfo in a php page. But,if I use php -v command then it shows php 5.5
ini path is shown /usr/local/lib/php.ini if using php page but through command it shows /etc/php.ini
please help...
The PHP 5.4 you compiled is not getting picked up by Apache. Rather than figuring out how to point Apache to this installation, the easiest (and safer since you'll get security updates) is to use the IUS Community repository
I have a couple of thoughts. If you're on CentOS you're probably using YUM as your package manager. With it, you could remove the PHP's and add a new one (if you don't have active clients using it). You can search what PHP version yum has by doing one of these:
yum list
yum list installed
If it registers multiple versions, you can "yum remove $package".
If you're php -v showing version 5.5, then your path is set to include that. You can see that by typing $PATH from the command line when SSH'd in. In your ~/.bashrc (or ~/.profile) you can edit your $PATH by adding something like:
export PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
EDIT: You should back up your PATH before writing a new one and after you edit it type "source ~/.bashrc" or "source ~/.profile" to make the command line see it.
You can also directly edit the php in the .bashrc to point to the correct version by setting up an alias (if you don't fix the root of the problem) like
alias php="/path/to/php"
You can see where your current php is by typing:
which php
Your PHP extension comes from the apache httpd.conf file. You can find it somewhere like /etc/apache2/httpd.conf. Search for "LoadModule" or "LoadModule php" and see which extension of PHP your apache is pointing to. It may still be pointing to an incorrect version.
To answer your question about ICU, it comes from the "intl" extension. With yum, this is probably called php-intl or php54-intl or php54w-intl. You can do something like "yum search intl" and it should give you the exact extension name.
I hope this helps!

I install mcrypt by homebrew , and phpmyadmin still tell me it's missing

Sorry for ask this simple question, but I really can't find any useful information for mcrypr extension missing.
I code PHP on my Mac air, at first time. I sucked in every package's building, and every details was gone and crash,so,I reinstall all my OS and upgrade to OS X 10.8.
I read some tutorials about homebrew, second time, after I enable apache and PHP (already in OS X), I download homebrew and install mysql and mcrypt, and put PhpMyAdmin that download from official website in /Library/WebServer/Document/.
The steps I use was:
brew install mysql <= this is command i use , not just describe my action
brew install mcrypt <= command
make mysql startup when booting
add new line: extension = mcrypt.so in php.ini.default and rename to php.ini.
set mysql root name and pw.
Every log about install was right and success, the folder Cellar was there in /usr/local/. Folder mcrypt was there too.
But when I login phpMyAdmin,still find the line: mcrypt extension is missing still there
Some step I miss or, I add wrong line in php.ini?
And another question, if we install mysql by homebrew, and the charset will set to UTF-8 automatically? Cause my system show me this before i edit my.cnf :(
You should restart Apache so it can notice the newly-installed PHP extension.
Finally ...... I find a answer for my question.
In this Post,even question in this post was different from mine,but there is a very important idea I forgot.
At last , I use macports to create the same environment of PHP+Apache at /opt/local/xxxx/xxx
,homebrew is different from macports,macports didn't depend system's lib or files as much as possible,so I try to use macports and install mcrypt by:
sudo port install php5-mcrypt
when it's done,I copy crypt.so to php/extension/xxxx/xxxx , and it's work finally,maybe someone can reference this kind of answer :)

Categories