My php version is PHP 7.4.7 and my distro is lsb_release -a gives me
No LSB modules are avaliable
Distributor ID: TurnKey
Description: TurnKey GNU/Linux 9.12 (stretch)
Release: 9.12
Codename: stretch
and if I try to run the command sudo pecl install sqlsrv This is the output that I get
[root#360 ~]# sudo pecl install sqlsrv
downloading sqlsrv-5.8.1.tgz ...
Starting to download sqlsrv-5.8.1.tgz (186,879 bytes)
........................................done: 186,879 bytes
PHP Parse error: syntax error, unexpected end of file,
expecting function (T_FUNCTION) or const (T_CONST) in /usr/share/php/Archive/Tar.php
on line 2383
what do I need to do in order to install this module?
I'm totally unfamiliar with MS SQLserver, and PHP is not a language I have a lot to do with. But I'm intimately familiar with TurnKey, so let me have a crack at getting you going in the right direction! :)
Firstly TBH, I'm not sure whether your support question is a good fit for a Q&A site like this (at least not without much more info about the customisations that you've made and the steps previous to the issue where you find yourself). Regardless, I'll have a crack.
It's probably also worth noting that just in case it's nor clear, your current server is TurnKey v15.x - based on Debian 9/Stretch.
A quick google bought me to the MS docs which note there are some prerequisites. I'm not sure if these are related to your issue, but to ensure we're on the same page, please ensure that you have followed the relevant steps for Debian. I.e. as noted in these links:
https://learn.microsoft.com/en-au/sql/connect/php/installation-tutorial-linux-mac?view=sql-server-2017#installing-the-drivers-on-debian-8-9-and-10
https://learn.microsoft.com/en-au/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-2017#debian17
You also didn't note how/where you installed PHP 7.4 from? I'm assuming that you installed via https://deb.sury.org/ i.e. followed the Debian steps here: https://packages.sury.org/php/README.txt
Assuming so, then I also suggest making sure that you have the latest version of PEAR installed (i.e. the one from Ondřej Surý's repo and not the one from Debian). If you want to check, try this:
apt policy php-pear
The Debian Streth version is currently 1.10.1 (full string: "1:1.10.1+submodules+notgz-9+deb9u1"). From what I can gather, the version from sury.org should be 1.10.9 (full string: "1:1.10.9+submodules+notgz-1+0~20191119.13+debian9~1.gbp296d25").
And/or installing like this should do the trick (if you have everything else already set up - probably worth double checking afterwards):
apt update
apt install php-pear
A bit more googling suggests that once you have all that sorted and if you still get that same issue, then try reinstalling Archive_Tar before retrying again:
pear install Archive_Tar
If you still have issues after that, unfortunately, I'm out of ideas. Although it's probably worth reporting the issue to MS? The issue tracker for the msphpsql code is here: https://github.com/microsoft/msphpsql/issues
Related
I have an Ubuntu 18.04 server with Apache, PHP7.3, and MariaDB.
Now I need to install phpmyadmin and I tried to do that using the code below:
apt install phpmyadmin
But this command will install and replace the PHP7.4 with PHP7.3, whereas I need to keep using PHP7.3.
How can I do this?
How have you installed PHP 7.4, since Ubuntu Bionic (18.04) includes PHP 7.2 (https://packages.ubuntu.com/bionic/php)?
You seem to have gone outside of the standard packages (perhaps you're using the excellent effots provided by Ondřej Surý at https://deb.sury.org/). In this case, it's going to cause you some amount of grief to mix and match the newer PHP with the distribution's phpMyAdmin, because of these dependency problems.
You could force the matter. This is probably going to cause you problems, since Bionic packages phpMyAdmin 4.6.6, which is only supported up to PHP 7.1. https://serverfault.com/questions/250224/how-do-i-get-apt-get-to-ignore-some-dependencies has some instructions on ignoring the dependencies. I recommend avoiding this solution.
You could install your own phpMyAdmin. Download the source from phpmyadmin.net and uncompress it to your web root. You may need to add a short configuration file, config.inc.php, but mostly it just works with the default settings. https://docs.phpmyadmin.net/en/latest/setup.html has a quick start section.
You could downgrade your PHP, but you've already stated this isn't a good option for you, and I'm not sure how the Ubuntu package managers get phpMyAdmin working with this newer PHP version.
Clearly, I think the best solution for you to is to install your own phpMyAdmin.
I'm running VPS with VestaCP (CentOS) and I had previously installed InterBase for PHP 7.0.30, but after an yum-update and v-update-sys-vesta-all interbase was no longer running.
Here is what I've got so far:
Okay soo with new update the new PHP 7.1.17 version was installed. Allright, but the interbase module is not running with it.
And first thing I did was yum --enablerepo=remi install php71-php-interbase to install interbase for this new PHP version.
Tried to restart but still getting missing InterBase error if I try to use ibase_connect() function - therefor InterBase is still not properly installed.
I tried to follow PHP InterBase documentation on this, but I realized I have to compile it and add extra parameter on run, but the problem is that VestaCP uses different directories and libraries so I don't want to mess up my VPS.
Has anybody dealt with this? Any "howto's" to follow?
This answer is what #Mark Rotteveel already pointed out in the comments, but only with additional steps.
I had to compile PHP 7.1.17 from source with --with-interbase[=DIR] in configuration and then include it in php.ini
[UPDATE]
I found even faster way to do this automatically (if only I had known this earlier I would have saved few hours of research).
Answer
Just run yum -y install php php-interbase and you will be all set.
I am moving a Magento 1.8 web to a lower cost hosting and exhausted by phpmyadmin installation.
Magento 1.8 was suggested to run with PHP 5.4 and Mysql 5.5, therefore, I chose a Centos6.9 image and thought could be easier...The LAMP stack installation is smooth, but always got problem with phpmyadmin. I have tried PHP5.4 + Mysql5.5, PHP5.4 + Mysql5.6, PHP5.5 + Mysql5.6 combinations, none of them turn out success...
Most of online blogs suggest same way to install phpmyadmin which I followed as below:
wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -ivh epel-release-6-8.noarch.rpm
or
rpm -iUvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
then
yum install phpmyadmin
I thought the EPEL package will be able to automatically identify php modules already installed and install the right version phpmyadmin accordingly...
instead it seems stick with php 5.3 which is default php version with Centos 6....here is error message:
the list is very long and involved many php modules...
I am kind of newbie with linux server stuff...Can anyone help to address this issue and point a solution out? thank you in advance.
BTW, I am big fan of open source, but from this point, I feel a bit disappointed to open source products...especially when end user need to work with multiple of them together...it can never be said as user-friendly.
If you have the Remi repo installed you should be able to use:
yum install phpmyadmin --enablerepo=remi-php56
You have php 5.4.45 installed from remi-php54, so you need to enabled this repository to install any additional module.
As explained by the Wizard.
Please note than PHP 5.4 and 5.5 are not maintained anymore, so I hearthly recommend to upgrade to a supported release (5.6 or more recent)
P.S. phpMyAdmin in EPEL is quite old (4.0) but suitable for old PHP versions. For more recent version of PHP (5.6, 7 and up), you probably need the latest phpMyAdmin version 4.7 (which is available in "remi" reposotiry)
All,
I have compiled and installed Apache 2.2.32 successfully on Debian 8.7, following the directions at http://www.tecmint.com/install-and-compile-php-7-on-centos-7-and-debian-8/ but have received an error when compiling that it can't find a2enmod. Error below:
[preparing module 'php7' in /etc/apache2/mods-available/php7.load]
Can't exec "a2enmod": No such file or directory at /usr/bin/apxs line 578.
'a2enmod php7' failed Makefile:164: recipe for target 'install-sapi'
failed make: *** [install-sapi] Error 2
I have researched this error but most of my a2enmod searches result in finds for enabling ModRewrite for some reason (perhaps there's a link here?!). Anyway, I found the following question asked several months back, but there was no answer posted so I'm trying again:
https://stackoverflow.com/questions/38542193/a2enmod-doesnt-exist-when-compiling-apache-but-php7-compile-install-requires-i/42559640#42559640
The compile options are listed in the first link I gave, so I won't repeat them here, but I have followed the document to the letter, and it is using the same major versions of PHP, Apache and Debian as me. I don't know enough about the details of each of these or my platform to understand why this is, but I can't find how to install a2enmod anywhere, and aptitude searches give me nothing.
Can anyone help with this? I am trying to install the most recent version (9) of OwnCloud but I cannot get PHP 7 to compile!
Any help is much appreciated.
All,
After much of a headache, the answer appears to be in this article:
https://www.cyberciti.biz/faq/installing-php-7-on-debian-linux-8-jessie-wheezy-using-apt-get/
This tells us how to get the official debian repositories that include PHP 7 added to the apt repositories, then install them from there. This solves my problem by giving me php7, as for why it wasn't compiling itself remains a mystery.
You need install a2enmod binary, which for your Debian version is not in apache2.2-commonpackage, but in apache2.
So, simply, you have to do:
Debian 8+
apt-get install apache2
Debian wheezy
apt-get install apache2.2-common
Recently upgraded PHP and ran into the following error message while updating:
php_msgpack_serialize in Unknown on line 0
So first of all, never heard of this package. All searches for this package leads to a single PECL repo (which really doesn't mean anything either) - which has about zero mentions from the community.
A few more searches and I tracked the origin down to a repo for php-memcached-dev - a repository I've never seen or heard of.
Of course, I have heard of the actual memcached library repo: libmemcached
I tried looking for this module everywhere for a sign of it being a legit part of centos but i can't seem to get any good/reliable results.
Places I searched for any sign of this package and/or repository:
http://pkgs.org/
http://stackoverflow.com
http://php.net
http://centos.org
Just searched https://bugs.php.net too...
I don't want to seem paranoid here, but I'm not even sure if this is legit at this stage.
Shrug - I dunno. I'm keeping my server turned off though until I see something else. Anyone have some advice/input ?
For the paranoid (and yes, I found it from being a little bit myself), here is an ugly google search : php_msgpack backdoor (note: only has 2 3 search results. Check out the date in the 2nd 3rd. i haven't clicked it myself and would not recommend anyone else click it either) This seems to be a rkhunter search looking for the same file being reported above. Probably just a coincidence but who knows. Thought I'd push it out there anyways.
UPDATE: Well, long story short this turned out to be an issue with a version of PHP that was installed with Cent. It has been fixed with the latest version.
On Ubunu 16.04 with PHP 5.5 from the Ondrej-PPA (https://launchpad.net/~ondrej/+archive/ubuntu/php) I could solve the problem by installing the package php-msgpack:
sudo apt-get install php-msgpack
And than enabling the php-msgpack with
sudo phpenmod msgpack
Perhaps you ave to restart apache2 after that if you use it with PHP.
Than this error is gone:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20121212/memcached.so' - /usr/lib/php/20121212/memcached.so: undefined symbol: php_msgpack_serialize in Unknown on line 0
One last thing to check:
msgpack extension must be loaded before memcached.
In my scenario extensions were loaded alphabetically and therefore memcached was loaded before msgpack. Php cli didn't work until I loaded msgpack before memcached.
Following commands solved my issue.
sudo apt-get install php-igbinary
sudo apt-get install php-msgpack
sudo service php7.3-fpm reload #Change to your version
Reference:
https://laracasts.com/discuss/channels/forge/php-71-update-broken-memcached
If you land here in Oct 2020 because you're getting an error after upgrading and you're using the repository ppa:ondrej/php you need to install the specific version of msgpack because all-of-a-sudden memcached is looking for this shared object.
We're running php 7.3 from this repo and although php-msgpack was installed, we needed to install php7.3-msgpack (which wasn't needed until this upgrade). No need to "enable" it as mentioned in the accepted answer. Just restart php.
Two steps:
sudo apt install php7.3-msgpack
sudo systemctl restart php7.3-fpm.service
http://msgpack.org/
http://pecl.php.net/package/msgpack
https://code.google.com/p/php-msgpack/
If your codebase doesn't use MsgPack, you can remove it from the php.ini and/or smaller files that mention it in the php.d/* subdirectories.
Well, long story short this turned out to be an issue with a version of PHP that was installed with Cent. It has been fixed with the latest version.