Unable to connect to Cassandra after upgrade to 3.0.0 - php

I've upgraded Cassandra to 3.0.0 some minutes ago through apt-get upgrade (on Ubuntu Linux 14.04 LTS) and after installation and restarting I could connect to my keyspaces using the cqlsh tool and all was ok but when I tried to connect using the DataStax PHP Driver the first time I got "All connections on all I/O threads are busy" but now I get "No hosts available for the control connection". Connection data are the same, so 127.0.0.1 and the default port 9042, I didn't change nothing in configuration. I've tried to downgrade Cassandra to 2.2.3 but after installation it doesn't complete the start sequence. Is this a bug, of Cassandra or of PHP Driver?
There are any ways to restore it without lost datas (with 3.0 or lower version)?

Edit: Version 3+ is not supported. Not even their enterprise version supports Cassandra 3+: Compatible versions of DataStax Enterprise and Cassandra
The error messaging of the DataStax PHP Driver could use some improvement...
Things that got me before with this error message:
Make sure you are connecting to the right server.
Might be a conflict
between the different versions.
But as far as I know, the DataStax PHP Driver does not support Cassandra 3+. Only version 2.1. And also version 2.2, but not completely.
From their docs:
Compatibility
This driver works exclusively with the Cassandra Query
Language v3 (CQL3) and Cassandra’s native protocol. The current
version works with:
Apache Cassandra versions 1.2, 2.0 and partially 2.1 DataStax
Enterprise 3.1, 3.2, 4.0 and 4.5 PHP 5.3.4+ Compilers: GCC 4.1.2+,
Clang 3.4+, and MSVC 2010/2012/2013 NOTE: Apache Cassandra 2.1 support
is limited to the Cassandra 2.0 API (native protocol v2), e.g. no
user-defined types.
DataStax PHP Driver for Apache Cassandra
Unfortunately I don't know anything about downgrading Cassandra...

Related

Need to install PHP 5.6 into RHEL 8.3 with supporting sybase and oci8

I have to install PHP 5.6 in RHEL 8.3
Must have sybase and oracle module as these are used for database connections.
What do I have to add to php installation to get these modules installed as well?
PHP 7 or above versions were not considered because doesnt support sybase module
Otherwise which version of php and rhel should i use to work with sybase ASE 15

Is there any way to enable LDAP support on MAMP when running PHP 7.3 or higher on macOS?

I use MAMP 5.5 (383) on my macOS Catalina (10.15.6) for general PHP related development. Some of my projects require LDAP connectivity for various reasons.
My process works well using MAMP, but recently I noticed that if I switch from whoever PHP version I have available in either app from PHP 7.2 to PHP 7.3 or above, all LDAP support stops; I get errors like this:
[30-Jul-2020 23:59:14 America/New_York] PHP Fatal error: Uncaught Error: Call to undefined function ldap_connect() in /Users/Jake/htdocs/ldap_test.php:3
Stack trace:
#0 {main}
And the only command in that file is simply a test ldap_connect() command.
In MAMP when I do a phpinfo() call, when it is running PHP 7.3.8 I see no LDAP references even in the configure command. But when I switch to PHP 7.2.21 I see --with-ldap in the configure command as well as this:
LDAP Support: enabled
RCS Version: $Id: 3839f871a91c293a52322c63329c68db23a0290a $
Total Links: 0/unlimited
API Version: 3001
Vendor Name: OpenLDAP
Vendor Version: 20428
Why is this?
I have tried to upgrade to MAMP 5.7 that has PHP 7.3 as well as PHP 7.4 but I get the same results; no LDAP support.
Has something happened in the way that OpenLDAP is supported in packages like this? I found this Homebrew related discussion which states the following and refers to this reported issue in an official PHP bug report:
“I can patch PHP 7.2 and older to use system LDAP again, but PHP 7.3 will require new symbols that only openldap exposes.”
Does this effectively mean that LDAP support in macOS is dead for PHP 7.3 and above unless there is a patch to PHP code or on the other side in the macOS implementation of OpenLDAP?
I use Ubuntu and CentOS as well and I can easily enable LDAP support via package installers there. But that’s little help when using MAMP for desktop development.
Looking for a solution that centers on the MAMP application and would like to avoid Homebrew or other setups where I am effectively building an M(acOS)AMP server from scratch on macOS.
Looks like this issue has been solved as of MAMP 6.3
LDAP support is back in the versions of PHP that come with MAMP 6.3 and higher.
Deciding to check a newer version of MAMP — since PHP 8 is looming and sticking with PHP 7.2 is no longer a real option — I downloaded MAMP 6.3 and it comes with PHP 7.4.12 and PHP 8.0.0 installed.
And without saying anything else… Both versions of PHP here have LDAP support baked in right out of the box! Confirmed by using a basic ldap_connect command as well as taking a few small apps I have developed around the block in these new versions of PHP and all works great!
So it seems like the PHP 7.3 cycles for MAMP had a weird “no-LDAP” blip. I recommend anyone wanting to move forward in their code, just download MAMP 6.3 and use PHP 7.4 at least and you should be solid.
The vendor version of LDAP contained in MAMP 6.3 is 20448 for anyone who needs to know that.

Configuration Issues with SQLSRV for PHP for MSSQL

I am installing a configuration with WampServer 2.4:
- Windows 7 64-bit sp1
- WampServer 2.4 64-bit
- PHP 5.4.3 64-bit (came with the WampServer)
- Apache 2.4.4
- Microsoft SQL Server 2012 Native Client 64-bit
- Microsoft SQLSRV 3.0 (php_sqlsrv_54_ts.dll, php_pdo_sqlsrv_54_ts.dll and they are put in c:/wamp/bin/php/php5.4.3/ext/
And I edited the C:\wamp\bin\apache\Apache2.4.4\bin\php.ini with the lines:
- extension_dir = "c:/wamp/bin/php/php5.4.3/ext/"
- extension=php_sqlsrv_54_ts.dll
- extension=php_pdo_sqlsrv_54_ts.dll
And I restarted all the services from Wamp.
But I still couldn't see the SQLSRV section from phpinfo -- and of course my connection test program failed.
What might have gone wrong?
Can anyone help?
Your issue is because you are using (or WAMP has given you) 64bit php, where as your sqlsrv driver is most likely 32bit.
Your solution is to switch to a 32bit version of php (The benefits of running in 64, are pretty much non existent anyway unless you need larger data types), or to recompile the sqlsrv driver in 64bit (Likely more trouble than it is worth).
Try a WAMP 32 bit version. http://www.wampserver.com/en/#wampserver-32-bits-php-5-4
Also if Apache and my-sql are of no consequence to you (they are just a web sever and and an sql database) you can install a WISP PHP Stack in a breeze using the web platform installer. http://www.microsoft.com/web/downloads/platform.aspx
For those of you using a 64bit version of PHP, the unofficial dll files linked below will work:
http://robsphp.blogspot.co.uk/2012/06/unofficial-microsoft-sql-server-driver.html
I am using 64bit WAMP on a 64bit Windows Server and was about to call it quits before I found those DLL files. It's odd that the official DLLs don't work with 64bit PHP, but I'm glad I at least found a solution.
I'm using just Apache 2.2 and PHP 5.4 in 32bit with SQLSRV 3.0 and it is now working. Note that the Thread Safe is set to Yes, thus SQLSRV ts.dlls should be used. It was a struggle. Hope this helps others.

PDO SQL Server extension faulting intermittently

I'm getting intermittent Error 101 connection reset and Error 15 Socket Not Connected from my dev server after switching database drivers. The reason seems to be the PDO Sqlsrv drivers I'm trying to use to connect to a SQL Server 2005 database using the SQL Server 2008 R2 SQL Native Client.
My windows event log shows this in Application Errors right at the time of each failure:
:
Faulting application path: C:\wamp\bin\apache\apache2.2.17\bin\httpd.exe
Faulting module path: c:\wamp\bin\php\php5.2.11\ext\php_pdo_sqlsrv_52_ts_vc6.dll
The server is Windows Server 2008 R2 running Apache 2.2.17 from WAMPServer 2.1, the issue occurs on both PHP version 5.2.11 and 5.3.9. The old mssql driver worked fine on 5.2.11.
I got the latest versions of the drivers from the official Sqlsrv driver project on codeplex. I'm using the Thread Safe version of the drivers as I'm using thread safe PHP. I confirmed thread safety is not the issue/ I used the VC6 version of the drivers with PHP 5.2.11 as my copy was compiled with VC++ 6, and I used the VC9 versions of the driver with 5.3.9 as it's compiled with VC9.
What is the problem or how can I isolate it?
There is an updated version that adds support for SQL Server 2012, though I don't know if that will help.
http://www.microsoft.com/download/en/details.aspx?id=17308
Does the non-PDO version of the driver cause the same problems?
This was apparently the result of an incorrect server configuration. Reinstalling the server from scratch and using PHP 5.3.9, Apache 2.2.21 and the sqlsrv driver 2.0 worked with fresh copies of the php.ini and httpd.conf files. I believe I improperly copied some settings from the old server's configuration which caused wonky behavior.

Upgrade PostgreSQL 8.1 to 8.3 on Debian Lenny, but zend php still recognize pgsql as version 8.1

The story goes like this:
I have Zend server CE PHP5.3 with all the modules available enabled running on Debian Etch.
I decided to upgrade Debian Etch to Lenny, then also upgraded PostgreSQL 8.1 to 8.3
Restored the database mydatabase --> $ psql mydatabase < schema_and_data.sql
Checked the web site that connects to a postgreSQL database and got this error.
Error: Failed to connect to database.
So I manually login to postgreSQL -> postgres#devserver:/$ psql mydatabase
Obviously postgreSQL is fine with mydatabase as my database
I checked phpinfo and PostgreSQL(libpq) Version : 8.1.1 (which was the previous version instead of the new 8.3)
I'm stuck at #6 at the moment.
Aside from doing the following that I think would fix it back to 'working condition':
Also downgrading postgreSQL 8.3 to 8.1 is not allowed as postgresSQL 8.1 is not supported on Lenny.
Setup my Debian box back to Etch and install zend/postgreSQL 8.1.
Any idea how to re-configure php-5.3-pgsql-zend on Lenny to recognize the new 8.3 version? Thanks!
If you haven't restarted your web server or php-cgi process, try that. They probably still have an old copy of libpq and/or the php pgsql stuff loaded.

Categories