Using Cassandra with PHP 7.1 - php

From the research I've done, https://github.com/datastax/php-driver/ seems to be the best option for using Cassandra with PHP.
However when I try to install it, I get the error: pecl/cassandra requires PHP (version >= 5.6.0, version <= 7.0.99), installed version is 7.1.4-1+deb.sury.org~trusty+1
I tried installing https://github.com/aparkhomenko/php-cassandra but it didn't work, giving this error: warning: Could not find remote branch deprecated to clone.
fatal: Remote branch deprecated not found in upstream origin
Unexpected end of command stream
I tried http://evseevnn.github.io/php-cassandra-binary/ but it seems like Cassandra 3.1 isn't supported
Is there any way to use Cassandra with PHP 7.1? I'm willing to go back to PHP 7.0.x if necessary, but I'd like to avoid doing that if possible.
Thanks to anyone who can help

Currently the DataStax PHP driver for Apache Cassandra does not support PHP v7.1.x (only versions 5.6.x and 7.0.x). There is a JIRA ticket (PHP-155) to add support; contributions are always welcome.

Related

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.

TYPO3 can't display the Backend

So I set up TYPO3 on Red Hat Enterprise Linux Server release 7.6 and I downloaded PHP 7.2.15. After I updated the PHP version the whole backend broke.
Here is my System:
Red Hat Enterprise Linux Server release 7.6 (Maipo)
TYPO3 CMS 8.7.6
PHP 7.2.15
MYSQL 5.5.60
When I log in with my password at http://myurl.com/typo3/
it simply sais this:
Uncaught TYPO3 Exception
#1476107295: PHP Warning: count(): Parameter must be an array or an object that implements Countable in /var/www/typo3/vendor/typo3fluid/fluid/src/ViewHelpers/CountViewHelper.php line 67
Here is also a screenshot of my error page:
What should i do?
I only have TemplaVoila+ installed.
Help is appreciated.
You encountered this issue: https://forge.typo3.org/issues/82227
Solve it like this:
Update your TYPO3 Core to the latest TYPO3 8 Version (currently 8.7.24)
replace TYPO3 8.7.6 Core with 8.7.24, then access http://myurl.com/typo3/install (install tool) and execute the update-wizard
check if PHP 7.2 is working now as this should also update "typo3fluid" (https://github.com/TYPO3/Fluid)
This should fix your problem.
For the future: always upDATE at TYPO3 asap. With upGRADES you can wait untill all extensions are compatible as TYPO3 supports LTS Versions quiet long :)
try to run the install tool (as stand alone).
clear all caches.
check for broken extensions.
do system checks.
otherwise: disable all extensions in your PackageStates.php one after the other until your system is running again (of course: start with non core extensions, start from the end)

cakephp 3 installation error with composer

I have Php 7 installed but whenever I try to install CakePHP from the command line using composer I get this error:
Your version of PHP, 5.4.0beta2-dev, is affected by CVE-2013-6420 and cannot safely perform certificate validation, we strongly suggest you upgrade.
my PHP version is up to date and I can't install CakePHP locally as it will provide many errors
Just read that error message again. It's more than clear:
Your version of PHP, 5.4.0beta2-dev, is affected by CVE-2013-6420 and cannot safely perform certificate validation, we strongly suggest you upgrade.
You obviously don't run php 7 in your CLI environment.
https://unix.stackexchange.com/questions/163762/php-cli-and-bash-change-behaviour-of-php-keyword
Use different PHP version CLI executable for one command
How to access PHP with the Command Line on Windows?
Let me google that for you

Php 7.1.9 mcrypt library not found

I have installed Php 7.1.9 on a windows server 2012 machine, if I check the php info I can see that mcrypt is enabled but if I type in shell php -v I have this error:
Unable to load dynamic library 'C:/php/ext\php_mcrypt.dll' - The specified module could not be found.
In fact running a Laravel application I also get some exception related to it.
I have checked ext folder and there is no php_mcrypt.dll .
As you can see here mcrypt is deprecated in favour of OpenSSL. From the Deprecated features in PHP 7.1.x:
The mcrypt extension has been abandonware for nearly a decade now, and was also fairly complex to use. It has therefore been deprecated in favour of OpenSSL, where it will be removed from the core and into PECL in PHP 7.2.
you can use laravel's homestead, it will be a lot easier since it will handle your environment with all the necessary services required by laravel framework.
https://laravel.com/docs/5.5/homestead

mysql_connect can not work in remote server in stead of local server

I got such warning :
Warning: mysql_connect(): Headers and client library minor version mismatch. Headers:50537 Library:50617
when try to upload my code to my remote server, and my remote server currently using php 5.5
, It's because the mysql extension has been already deprecated so that i have to change the extension to mysqli?
but in my local server, i tested in php 5.5 too and it works as normal
what would be the issue here?
If you are running ubuntu/debian.
apt-cache search php5-mysqlnd
Find one that fits:
apt-get install php5-mysqlnd
I think your issue is this:
After having MySQL 5.6.17 published, some users complained about a
warning thrown by their PHP applications :
PHP Warning: mysql_connect(): Headers and client library minor version
mismatch. Headers:50535 Library:50617
In fact, this could happen with any application linked to
libmysqlclient18 in a certain version (php5-mysql from Dotdeb is
linked to the 5.5.35 version from the stock Debian distribution) when
connecting to a MySQL server in another version (5.6.17 in our case).
The warning is thrown by libmysqlclient18 itself. And this is just a
warning, there is no reason why any bad behavior would happen in that
case.
Of course, I could build php5-mysql against the latest
libmysqlclient18 (5.6.17), but it would lead to very bad issues, such
as duplicate symbols or segfaults when PHP is loaded with other
MySQL-linked modules from the stock Debian distribution (those are
linked to libmysqlclient18 5.5.35). For example : mod_php5 + Apache +
mod_auth_mysql would crash.
If this this warning really annoys you, feel free to install
php5-mysqlnd instead of php5-mysql :
it’s a drop-in replacement
it’s not linked against any libmysqlclient library
it won’t throw any irrelevant warning about version mismatch
it has a lot of benefits. See http://www.php.net/mysqlnd for more info
I hope this helps.

Categories