Installing PHP 7.0.0RC2 with mysqli on Raspberry Pi B - mysqli

Last week I installed PHP 7.0.0RC2 on my Raspberry Pi B.
I am able to view PHP pages, however, the problem is that I cannot connect to the database using mysqli (I know that mysql is no longer supported in PHP v7).
I ran the ./configure command with --with-mysqli=shared.
However, when I check which modules are installed using the php -m command, I do not see mysqli.
I tried adding extension=mysqli.so to the php.ini file.
It first complained that the mysqli.so file could not be found, so I tried copying the mysqli.so of my php5 version to the extensions folder.
However, this did not solve the problem and resulted in the following error message:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20141001/mysqli.so' - /usr/local/lib/php/extensions/no-debug-non-zts-20141001/mysqli.so: undefined symbol: zval_used_for_init in Unknown on line 0
Does anyone got any suggestions of how to get mysqli to work with my PHP7 installation on my Raspberry Pi?

You may find detailed information in the configure output, but it's pretty hard to catch, and if it's not a fatal error, won't stop the build going ahead when you make.
The recommended (read: only decent) driver for MySQLi is the MySQL Native Driver (mysqlnd).
If you want MySQLi to be built shared, you must also build mysqlnd shared, and everything that depends on it (PDO MySQL, for example).
It's going to be simpler to just build the native drivers static, using the configure option:
--with-mysqli=mysqlnd
Which will enable a static build of mysqlnd and mysqli.
If for some reason you really do want to build shared, then you'll need configure options that closely resemble, if not are exactly the same as:
--enable-mysqlnd=shared
--with-mysqli=shared,mysqlnd
Which will result in a shared build of mysqlnd and mysqli, requiring you to add extension=mysqlnd.so and extension=mysqli.so in the appropriate order (the latter depends on the former), in the appropriate place.
Remember to make distclean before you re-configure the build, surprising things will happen if you do not ;)

Related

Variant Effect Predictor | DBD mysql failing to setup

I trying to get set up with Variant Effect Predictor (VEP) on the command line. I'm following the setup tutorial but I'm encountering some errors around dependencies. I'm also quite new to the command line so if anyone is able to break down the solution too then I'd be very grateful. Thanks!
Tutorial: https://www.ensembl.org/info/docs/tools/vep/script/vep_tutorial.html
VEP requirements: http://www.ensembl.org/info/docs/tools/vep/script/vep_download.html#requirements
I also have Perl v5.32.1.
What I've done:
I installed dependencies (listed in the requirements page) with the following commands:
- sudo -s cpanm DBI
- sudo -s cpanm Archive::Zip
- sudo -s cpanm DBD::mysql
For DBD:mysql, I got the follwoing message:
--> Working on DBD::mysql
Fetching http://www.cpan.org/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz ... OK
Configuring DBD-mysql-4.050 ... N/A
! Configure failed for DBD-mysql-4.050. See /root/.cpanm/work/1626111140.5937/build.log for details.
Trying it out anyway, I ran perl INSTALL.pl (from the tutorial page) and got the message below. I would like VEP to run in online mode too if possible.
`WARNING: DBD::mysql module not found. VEP can only run in offline (--offline) mode without DBD::mysql installed
http://www.ensembl.org/info/docs/tools/vep/script/vep_download.html#requirements
Hello! This installer is configured to install v104 of the Ensembl API for use by the VEP.
It will not affect any existing installations of the Ensembl API that you may have.
It will also download and install cache files from Ensembl's FTP server.
Checking for installed versions of the Ensembl API...done
Setting up directories
Destination directory ./Bio already exists.
Do you want to overwrite it (if updating VEP this is probably OK) (y/n)? y
- fetching BioPerl
- unpacking ./Bio/tmp/release-1-6-924.zip
ERROR: Unable to unpack file ./Bio/tmp/release-1-6-924.zip without Archive::Extract or tar/unzip/gzip`
You show us this error:
Configure failed for DBD-mysql-4.050. See /root/.cpanm/work/1626111140.5937/build.log for details.
So looking in there will give you more clues about what the problems are. Without that, we can only guess.
But we can make educated guesses. The DBD::mysql distribution comes with a file called DBD::mysql::INSTALL which will talk you through some of the problems you'll find while installing this module.
It's important to note that DBD::mysql is a wrapper around MySQL's client libraries. They are written in C, so you'll need a C compiler installed in order to build DBD::mysql. You'll also need the client libraries and the development versions of the client libraries (for the C header files that you'll need to compile the module). On Ubuntu, those packages are called "libmysqlclient" and "libmysqlclient-dev". If you don't have a C compiler, then you'll want to install "gcc" too.
But this is all getting a bit complicated. There's another, simpler, approach. If you're using the system version of Perl (the version that was installed as part of the operating system and probably lives in /usr/bin/perl) then I'd recommend using the pre-build Ubuntu version of the package, which you can install by running:
$ sudo apt-get install libdbd-mysql-perl
Installing that version uses the OS's own package manager, and the package manager knows which other packages are needed in order for it to work - so it will install those as well.
People will probably complain that you're better off installing the modules from CPAN as it gives you more flexibility and allows you to use more up-to-date packages than the versions from your OS repos. And they're right. But, honestly, if you're a non-Perl programmer who just wants to get an application up and running, this is by far the simplest approach.
(But, as I said above, this is all guesswork as you haven't shared the most important errors with us.)

Compile quickfix without mysql

I want to compile quickfix library, I don't have any MySQL installed on my computer and it is not necessary for me. I tried to disable the mysql from the configure --without-mysql but when I compile, I still see -lmysqlclient in my compiling command and it eventually fails because I don't have this library file. How can I disable this?
Also, if I tried to compile with old gcc4.1.2 (newer version like 4.8 is fine), but I cannot even generate the configure file but keeps seeing this error:
configure: error: unable to find set_terminate in std or global namespace
There should be any problem with this compiler because I can compile many other things and I have to use this version of the compiler because many of my libraries are compiled under this version.
I assume, you want to compile C++ source codes - http://www.quickfixengine.org/quickfix/doc/html/building.html. The tutorial indicates that MySQL is optional. To install MySQL support, you need to explicitly add --with-mysql flag. There is not --without-mysql flag.

PHP5 - pgsql Module not loaded

I am trying to get work PostgresSQL with PHP, but i stuck on that apache error:
Call to undefined function pg_connect().
When i run phpinfo() i cannot see that my module is loaded, but i do not know why. The pgsql.ini files were loaded. And when i open them, i can see, that the extension is enabled extension=pgsql.so. Under /usr/lib64/php5/extensions there is the .so file. Even the permission are same like the other modules.
Any idea what am I doing wrong?
It would help if you could describe what operating system you are using. I'm assume Linux, but which distribution? One package that is often forgotten when installing postgresql and php is php5-pgsql. This is the connection between the two. For some reason I cannot explain, it is best if all three are installed together. So I suggest uninstalling postgresql and php and then installing postgresql, php5 and php5-pgsql. I hope this works for you!
I found it out. Some libraries where not found.
1.) First of all run php -version
2.) If there is an error where it described that some libraries are missing, you can solve it like me
3.) Search for the files on your system find / -name {LIBRARY NAME}
3a.) If you found them, just create a symlink to /usr/lib64
3b.) If not, find a way to get them and 3 3a

cross-compile postgresql for ARM Sitara AM335x

I'm having trouble cross compiling PostgreSQL for my TI Sitara AM335x EVM SK. My host system is an i386 machine running Ubuntu 12.04.
My application is written in C++ using Qt. When I try and compile, I get the error that libpq.so is incompatible. I believe this is because the cross compiler is trying to use the host libpq.so instead of one for the target system (which as I have found out, doesn't exist).
I've downloaded the source for PostgreSQL with the intention of cross compiling that in order to give me the libpq.so library that will be compatible with my target system, however there is virtually no information on how to do this.
I have tried using the CC argument with the configure file to change my compiler to the following: CC=/home/tim/ti-sdk-am335x-evm-06.00.00.00/linux-devkit/sysroots/i686-arago-linux/usr/bin/arm-linux-gnueabihf-gcc but the configure script gives me this error: configure: error: cannot run C compiled programs. If you meant to cross compile, use --host.
The configure file makes a small reference to the --host option, but the only information in the file that I could find is in reference to mingw and windows, which isn't what I want.
I've done some quick searching through the configure file, and it references the --host option, but with no explanation of what is a valid host. I'm assuming that with --host option there will be an associated --target.
What arguments can I give the configure script so that it will cross compile with the correct compiler to generate a library that my target device can use? Are there any resources out there that I haven't found in regards to how the --host/--target works or how to use them?
OK, so after fiddling around for a little while, I think I was actually able to cross compile PostgreSQL and answer my own question.
Before I went any further, I had realized I had forgotten to add the path to my cross compiler to the PATH environment variable. I used the command export PATH=/path/to/cross/compiler:$PATH to insert the compiler path to the PATH environment variable.
Next, I did some experimenting with the --host option. To start off with I tried using ./configure --host=arm-linux-gnueabihf and running the configure script. The configure script seemed to accept this as the host argument. I then went to the next step of running the makefile. Running this makefile resulted in errors being generated. The errors were selected processor does not support Thumb mode. I did a quick search to see what information I could find about this error and came to this webpage: http://www.postgresql.org/message-id/E1Ra1sk-0000Pq-EL#wrigleys.postgresql.org.
This webpage gave me a bit more information since it seemed like the person was trying to do something very similar to me. One of the responders to the post mentioned that --disable-spinlocks is intended for processors that aren't supported by default by PostgreSQL. I emulated the arguments that were used in the website listed above and used the command: ./configure --host=arm-linux CC=arm-linux-gnueabihf-gcc AR=arm-linux-gnueabihf-ar CPP=arm-linux-gnueabihf-cpp --without-readline --without-zlib --disable-spinlocks to generate my makefile. This makefile actually generated all of the files, including the libpq.so library file I was needing.
Hope this helps somebody else in the future!

Problems installing/compiling DBD::mysql on OpenSuSE 10

I am getting a bunch of compile errors when I try to install the MySQL DBD::mysql Perl library. I am trying to install this library on OpenSuse linux (SUSE Linux Enterprise server 10 (x86_64) version 10, patch level 4)
The install fails when trying to compile dbdimp.h. There are hundreds of complile errors but I have reason to believe they all stem from the first 3:
dbdimp.h:23:49: error: mysql.h: No such file or directory
dbdimp.h:24:45: error: mysqld_error.h: No such file or directory
dbdimp.h:26:49: error: errmsg.h: No such file or directory
I believe that the reason I am getting the errors above is that I have no MySql Client installed. I do not know how to install mysql client (I believe I am supposed to get some version of libmysqlclient).
I am brand new to opensuse and vaguely familar with installing packages on Linux in general have used yum, yast, apt-get on ubuntu + centOS previously but the only package manager tools that seem to be on OpenSuse 10 are rpm and zypper. I have not managed to install the required mysql client using either of these. If anyone knows how to install MySql Client to resolve my issue I would greatly appreciate any recomendations
Thanks
You need to install MySQL or the MySQL client libraries, either through your system's package manager or by following the installation instructions from the source code.
It sounds like your question is really "How do I install MySQL on OpenSuse", which would be more appropriate for one of the other StackExchange sites.
I was able to resolve this to a point. In my original question, I stated that I had tried using YAST but that it had not worked. In fact, I did not fully explore the YAST install option but when I did, I managed to download install the required librarys by following an article I found (http://adminramble.com/install-mysql-yast/#chitika_close_button)
I was able to open the YAST GUI in the terminal window (not an X-window display) and navigate through the "software management" section wherein I was able to do a search for MySql. Amoung the search results were mysql client libraries, which I then selected and hit "Accept". The installation started and completed successully.
In order to complile the PERL DBD::mysql module, I had to create a new makefile with the ccflags specified so that the header files could be found:
perl Makefile.PL --cflags -I/usr/include/mysql
I say "to a point" at the top of this comment because I then ran into further problems compiling but my original issue posted has been partially resolved and getting this far may help someone else who is experiencing the same problem. Will update if I get a solution to the compile problem.