There is no Driver for DataStax Graph in PHP - datastax

DataStax Enterprise 5.0 doesn't have a PHP driver. I need to use DSE Graph, What do I do ? Write Python Code and somehow run it using PHP ?
Is there a timeline of when they are going to release this ? Any ideas anyone ?

Since the PHP driver is built on top of the DataStax Enterprise C++ driver, it necessarily lags releases on that driver. There are no firm dates, but I can say the DSE C++ driver should be GA mid-October 2016, and the PHP driver will be RC status some weeks after that.
The alternative for now is to write in any of the other languages with GA graph support: Java, Python, Ruby, node.js, or C#.

Had contact with datastax and get it running now on CentOS 7:
# Download and install the dependencies for PHP DSE driver v1.0.0
sudo rpm -Uvh http://downloads.datastax.com/cpp-driver/centos/7/dependencies/libuv/v1.11.0/libuv-1.11.0-1.el7.centos.x86_64.rpm
sudo rpm -Uvh http://downloads.datastax.com/cpp-driver/centos/7/dse/v1.1.0/dse-cpp-driver-1.1.0-1.el7.centos.x86_64.rpm
sudo rpm -Uvh http://downloads.datastax.com/php-driver/centos/7/dse/v1.0.0/php70w-dse-driver-1.0.0stable-1.el7.centos.x86_64.rpm
# Ensure that the PHP DSE driver is installed correctly
php -i | grep -A 11 "^dse$
We are running here with zend server and we are getting the following error when trying to install the dse driver rpm:
error: Failed dependencies:
php(api) = 20151012-64 is needed by php70w-dse-driver-1:1.0.0stable-1.el7.centos.x86_64
php(zend-abi) = 20151012-64 is needed by php70w-dse-driver-1:1.0.0stable-1.el7.centos.x86_64
Checking we had the right version with:
phpize -v
Configuring for:
PHP Api Version: 20151012
Zend Module Api No: 20151012
Zend Extension Api No: 320151012
We solved this with installing the rpm with the flag nodeps:
sudo rpm -Uvh --nodeps http://downloads.datastax.com/php-driver/centos/7/dse/v1.0.0/php70w-dse-driver-1.0.0stable-1.el7.centos.x86_64.rpm
Then copy the dse.so to the plugin directory for PHP. And load the extension with a .ini file or directly in php.ini.
sudo cp /usr/lib64/php/modules/dse.so /usr/local/zend/lib/php_extensions/
The documentation of the PHP DSE API you can find here:
PHP DSE API

Related

sqlcmd not able to find a library (libmsodbcsql-17.0.so.1.1) that is there

I'm on Ubuntu 16.04 trying to use sqlcmd launched programmatically from a script to do a SQL query in the VM's cloud.
vm-dev:~$ sudo sqlcmd -S my-db.url.net -d my-db
I keep getting this error:
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Can't open
lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.0.so.1.1' : file
not found.
But the file is clearly there:
vm-dev:~$ ls /opt/microsoft/msodbcsql17/lib64/
libmsodbcsql-17.0.so.1.1
Just for those who are experiencing the same issue on Ubuntu 18.04 and came here but didn't have the issue solved by the accepted answer, since it's targeted to Ubuntu 16.04, sharing another possible solution, tested with an Ubuntu 18.04 docker container for a Python 3.6 application which relies on Microsoft's odbc driver.
Step 1: Check Library Dependencies
Check if all library dependencies are satisfied using the command ldd. On my environment, the missing libraries were libssl1.0.0 and libgssapi-krb5-2. Below, an example of the command and its output with a missing dependency, grep the output for not found if you will.
$ ldd /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.2.so.0.1
libfoo.so => /path/to/lib/foo/libfoo.so
libbar.so => /path/to/lib/bar/libbar.so
libbaz.so => not found
Step 2: Check Who Provides the Missing Dependency
Check which package provides the missing dependency using dpkg search.
$ dpkg -S libbaz.so
libbaz:amd64: /usr/lib/x86_64-linux-gnu/libbaz.so.1.2.3,
Step 3: Install Missing Dependency
$ sudo apt install libbaz
I have same problem, this solution worked for me:
you have to downgrade the msodbcsql version,
apt-get remove msodbcsql
apt-cache madison msodbcsql
apt-get install msodbcsql=13.1.9.2-1
apt-cache madison mssql-tools
ACCEPT_EULA=Y apt-get install mssql-tools=14.0.6.0-1
apt-mark hold mssql-tools
apt-mark hold msodbcsql
I got this solution from this link:
https://github.com/Microsoft/msphpsql/issues/684
I leave this scripts that worked for me.
My problem was pretty similar yours and I tested all the options such as changing the driver location, making a symbolic link, modify /etc/*.ini files, etc... nothing worked.
My problem, running python 3.6, pyodbc package in a docker container from alpine was the library libssl1.0.0
Here you will find my installation script for pyodbc Debian 8 (alpine) docker image using the driver v13
DRIVER={ODBC Driver 13 for SQL Server}
The command I run for database connection was:
import pyodbc
connection_string = 'DRIVER={ODBC Driver 13 for SQL Server};'
connection_string += 'SERVER={0};DATABASE={1};UID={2};PWD={3};'.format(host,dbname,user,pwd)
connection = pyodbc.connect(connection_string)

How to install Apache with PHP 7.0 on Ubuntu 16.04 using puppetlabs-apache

I moved the question to the server fault site.
I want to install Apache with PHP 7.0 on Ubuntu 16.04 using Puppet Labs Apache module.
Following the documentation the module supports Ubuntu 16.04.
There is a ticket related with PHP 7.0 support and there is an accepted merge request which should add PHP 7.0 support.
It looks like the fix provided in the merge is not included in module 1.9.0 version.
The questions are
Is there any way how I can use the suggested fix and install Apache with PHP 7.0?
What should I write in the manifest?
The following code (from Puppet manifest) does not work on Ubuntu 16.04
class { 'apache':
mpm_module => 'prefork',
}
include apache::mod::php
I've got the following error
Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install libapache2-mod-php5' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
Package libapache2-mod-php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libapache2-mod-php5' has no installation candidate
Error: /Stage[main]/Apache::Mod::Php/Apache::Mod[php5]/Package[libapache2-mod-php5]/ensure: change from purged to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install libapache2-mod-php5' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
Package libapache2-mod-php5 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'libapache2-mod-php5' has no installation candidate
I tried to configure FastCGI servers to handle PHP files but this fails too with almost the same error message. The module knows nothing about PHP 7.0 yet.

How can I build an RPM package in a Debian based system?

I'd like to build packages using a build system (i.e. jenkins, travis, etc) but all I have are Ubuntu 12.04 VMs.
I've found this [1] instructions but mach does not support CentOS 7.0.
[1] http://blog.burghardt.pl/2008/12/how-to-build-rpm-packages-in-centos-chroot-on-debian/
http://mojo.codehaus.org/rpm-maven-plugin/ <- rpm plugin for the maven build system
sudo apt-get install rpm # for Ubuntu
Check out the command that it installs called rpmbuild.
Found it! There is actually a tool called rinse: "Rinse is a simple tool which is designed to carry out the installation of a new RPM-based distribution".
rinse --distribution="centos-7" --directory="/tmp/centos-7"
http://collab-maint.alioth.debian.org/rinse/

Installation mod_wsgi for python3.2

I`m trying to install mod_wsgi for Python 3.2 on Debian 6 (Squeeze).
First I installed libapache2-mod-wsgi-py3 from default repository, and it was for Python3.1, then I add to source.list
*deb http://ftp.de.debian.org/debian wheezy main*
and call apt-get install libapache2-mod-wsgi-py3 again. After that sys.version in wsgi returs 3.2.3.
Is it truly mod-wsgi works with Python3.2 or that just bug?
If wishing to use Python 3.2, you must compile mod_wsgi from source code out of the mod_wsgi source code repository. Last tar ball and binary packages from distros wouldn't support 3.2.

Apache Response Time Monitoring in Hyperic

I seem to be having a hard time getting the Apache module for Hyperic to compile in Ubuntu 8.10. Has anyone had any luck getting it to work? Does anyone have a precompiled version?
I am running Hyperic HQ version 4.1.2 build #1053, Apache 2.2.x
I got it to work by doing the following:
Symbolically link aclocal and automake old hard coded version to your current version (replace version numbers 1.11 to your own):
sudo ln -s /usr/bin/aclocal-1.11 /usr/bin/aclocal-1.6
sudo ln -s /usr/bin/automake-1.11 /usr/bin/automake-1.6
Rename a conflicting header file:
sudo mv /usr/include/openssl/asn1.h /usr/include/openssl/asn_1.h
Run the installer:
sudo ./build_apache_snmp.sh -r 2.0 /usr/bin/apxs2
Once it is finished make sure you follow the directions located at ./README
Once you have confirmed that the SNMP service is working (using the snmpwalk application that the readme file refers to), reverse the steps above to revert system changes just needed to compile the plugin.