Webtatic PHP7.1 is missing - centos

After installing PHP7.1 using this on CentOS7
https://webtatic.com/packages/php71/
Running
php -v
Results in
-bash: php: command not found
The install worked but PHP is not there - have I missed a step?

Since you have installed php from webtatic, you'll need to install the cli SAPI.
To do that you need to run:
sudo yum install php71w-cli
After the installation, try running the below to see if it works:
php --version
https://webtatic.com/packages/php71/
Contained in the php71w-cli package, this SAPI allows running scripts from the command-line, and also has a built-in web server for development-use. Located at /usr/bin/php

I had similar issues on my computer. For me the command was just renamed to php7 or php71. So if have the same issue please create a symlink.
Find out where your php7 file is residing
$ which php7
/usr/bin/php7
Symlink this file
sudo ln -s /usr/bin/php7 /usr/bin/php
Test that this is working
php -v
Your problem should be solved. Only case might be that you need to change newly created file as executable or change the owner/group.
Please let me know if this was helpful.

Related

Timescale not finding pg_config on AMI

I created a machine in AWS Cloud9 and I want to install timescale on that instance. I have previously installed and setup postgres 9.6 using yum.
OS version is:
Amazon Linux AMI release 2018.03
.
When I run 'which pg_config', it is found here:
/usr/bin/pg_config
Looking at the install instructions on the timescale website, I came up with this:
sudo yum install -y
https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-6-x86_64/pgdg-ami201503-96-9.6-2.noarch.rpm
wget
https://timescalereleases.blob.core.windows.net/rpm/timescaledb-0.9.2-postgresql-9.6-0.x86_64.rpm
sudo yum install timescaledb-0.9.2-postgresql-9.6-0.x86_64.rpm
after the last command I get the following error:
Running transaction Installing :
timescaledb-0.9.2-0.el7.centos.x86_64
1/1 ERROR: Could not find pg_config, expected it at
/usr/pgsql-9.6/bin/pg_config. Please fix and try again.
warning: %post(timescaledb-0.9.2-0.el7.centos.x86_64) scriptlet
failed, exit status 1 Non-fatal POSTIN scriptlet failure in rpm
package timescaledb-0.9.2-0.el7.centos.x86_64
Do you have any more details on how you installed PostgreSQL on CentOS? I suspect this may have something to do with a mismatch between your pg_config installation and your PostgreSQL 9.6 installation, similar to the user in this issue.
I'd recommend uninstalling your current postgresql-devel and explicitly installing it for 9.6:
yum install postgresql96-devel
It seems the AMI is setup a bit differently than a normal CentOS install so PostgreSQL is installed in a different place than our installer expected. I've gone ahead and updated the RPMs to use a more robust method of finding the correct place to put the files. If you could re-download the latest RPM and confirm that it works that'd be great.
I've met exactly the same problem.
I solve this by manually linking them together.
sudo ln -s /usr/lib64/pgsql96/bin/pg_config /usr/pgsql-9.6/bin/pg_config

How to install MongoDB Driver in XAMPP mac (OSX)

I have installed mongodb and I can access it through my terminal. I want to install drivers for XAMPP in OSX (Yosemite). I downloaded mongo.so file and kept it under /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20131226 path which is my extension_dir pointing to and wrote extension=mongo.so in php.ini file but no luck. After restarting Apache I can't find any mongodb when I run phpinfo(). Please help. Maybe I just want the correct mongo.so file. Please help.
in command line...
sudo /Applications/XAMPP/xamppfiles/bin/pecl install mongo
if it gives ERROR: `phpize’ failed
Download autoconf
curl http://ftp.gnu.org/gnu/autoconf/autoconf-latest.tar.gz > autoconf.tar.gz
Untar the autoconf archive
tar -xvzf autoconf.tar.gz
Configure and make – note the folder un-archived may have a different name.
cd autoconf-2.69
./configure
sudo make && sudo make install
This installs autoconf to ‘/usr/local/bin/autoconf’. In order to get phpize to work set the PHP_AUTOCONF environment variable to point to the newly installed autoconf.
export PHP_AUTOCONF=/usr/local/bin/autoconf
write anywhere in php.ini: extension=mongo.so (not ;extension=mongo.so or ;extension=:"mongo.so") just write extension=mongo.so
then restart this
if you get any problem then let me know I'll for sure fix it...

How to run PHP 5.5.4 mcrypt run on CentOS 6.4?

I am getting the following error:
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib/php/extensions/no-debug-non-zts-20121212/mcrypt.so' -
/lib64/libc.so.6: version `GLIBC_2.14' not found (required by
/usr/lib/php/extensions/no-debug-non-zts-20121212/mcrypt.so)
Does mcrypt require glibc 2.14?
We are running CentOS 6.4 (latest stable version of CentOS) and it comes with glibc 2.12 (can't really upgrade glibc as being a core part of OS, changing it will likely break lots of stuff)
How do I make my PHP 5.5.4 run mcsypt under these circumstances?
Current configuration (phpinfo output) is here.
I was also having issues installing mcrypt on my VPS dev server so I thought I would post my solution in the hopes that it helps someone. I am running Centos OS 6.5 and had upgraded PHP to 5.5.13 using the Webtatic EL yum repository. https://webtatic.com/packages/php55/
First shh into your server
ssh admin#domain.com
initially I was trying to do (which was not working):
yum update
yum install php-mcrypt
I then realized my mistake when I looked at php -v and realized php-common was conflicting as the above code was trying to load a dependency from 5.3.
I then executed the following correct commands:
rpm -Uvh http://mirror.webtatic.com/yum/el6/latest.rpm
yum update
yum install php55w-mcrypt
service httpd restart
This worked perfectly for me.
I also read while researching this issue that some people did have to add the extension to their .ini file manually by adding the following line but i did not have to do this.
extension=mcrypt.so
you can find the location of your php.ini file by looking at phpinfo(); and see which configuration it is loading. For me the following ini files were loading:
/etc/php.ini
/etc/php.d/mcrypt.ini
/var/www/vhosts/system/domain.com/etc/php.ini
If the installation is successful then you will see the extension when you echo phpinfo();
Try installing php-mcrypt using yum. That should pull in any other libraries you need to run it.
yum install php-mcrypt
In light of your update, it would appear that you are trying to use the MCrypt extension built from another PHP Source which was created by an updated GLIBC library. The only proper solution I can see is the following:
You first need to ensure you have libmcrypt, libmcrypt-devel, and mcrypt installed before continuing. Check your CentOS repository.
Download the PHP Source from http://php.net
Untar the downloaded source tar -zxf php-5.5.4.tar.gz
cd into the source cd php-5.4.4
Copy your current ./configure string. The whole thing!
Add support for Mcrypt --with-mcrypt=/usr and run the new configure command
make && make install
restart Apache and PHP-FPM
This will keep your current configuration just as CentOS has built it but with the additional support of MCrypt as you are looking to have. Once you've done this, you do not need to enable the MCrypt extension in your php.ini file as it will be built into PHP itself and will be automatically loaded for you now.
When in doubt, you can also read up on the installation here http://us1.php.net/manual/en/mcrypt.installation.php

pecl instal ibm_db2 fails

I need to install ibm_db2 extension for making php connection with db2. So I have used pecl. But it produces error.
$ pecl install ibm_db2
When I run this, the below error occurs.
.....
checking in /home/db2inst1/sqllib/lib64...
checking in /home/db2inst1/sqllib/lib32... found
checking for DB2 CLI include files in default path... checking in /home/db2inst1/sqllib... not found
configure: error: Please reinstall the DB2 CLI distribution
ERROR: `/tmp/pear/temp/ibm_db2/configure --with-IBM_DB2=/home/db2inst1/sqllib' failed
Please help.
download ibm_data_server_driver_for_odbc_cli_linuxx64_v97.tar.gz from ibm.com
untar the file into: /opt/ibm/
enter command > pecl install ibm_db2
When prompted for DB2 Installation Directory, use: /opt/ibm/odbc_cli/clidriver/
You need the DB2 headers to build the ibm_db2 PHP extension. They are included in the IBM Data Server Driver for ODBC and CLI.
before install ibm_db2, you have install expc, in the folder uncompress execute the script db2_install with root user: # ./db2_install
It asks for the installation path (e /opt/ibm/db2)
then install ibm_db2
Install a DB2 instance (On Ubuntu due to following instructions: http://www.db2teamblog.com/2010/09/db2-express-c-packages-for-ubuntu-1004.html) This will work also on newer systems.
After that run the following command:
pecl install ibm_db2
When prompted type:
/opt/ibm/dbs/V9.7/
and confirm the installation directory
The error is because in the path /home/db2inst1/sqllib not found the include folder.
you must download db2exc_974_LNX_x86_64.tar.gz, uncompress it (e. /otp/ibm/db2)
then install pecl install ibm_db2
DB2 Installation Directory? use this : /opt/ibm/db2
Check also the first comment on PHP manual by Jean Ferreira.
link
You need the APPLICATION DEVELOPMENT TOOLS when you install the client you should have the option to install them.
Check your /home/db2inst1/sqllib/include folder you'll see that you only have asn.h, a boatload of files is missing when you don't have the development tools installed.
Then use /home/db2inst1/sqllib as your install directory.
I lacked the APPLICATION_DEVELOPMENT_TOOLS in my DB2 installation (confirmed by only having asn.h in my includes folder)
To install the APPLICATION_DEVELOPMENT_TOOLS into an existing DB2 installation, follow these instructions
Check your product information. You will need this information later.
db2ls -p -q -b /opt/ibm/db2/V10.5
Download the appropriate Universal Fix Pack from IBM:
https://www-945.ibm.com/support/fixcentral/swg/selectFixes?parent=ibm~Information%2BManagement&product=ibm/Information+Management/DB2&release=All&platform=Linux+64-bit,x86_64&function=textSearch&text=universal
Be sure to find the matching FixPack version (from the step above) and the correct architecture.
Save the file to /opt/ibm/fixpack
Gunzip/Tar the file
cd /opt/ibm/fixpack
gunzip /opt/ibm/fixpack/downloaded_pack.tar.gz
tar xvf /top/ibm/fixpack/downloaded_pack.tar
Create a response file /opt/ibm/fixpack/devtools.resp like this.
Replace the PROD value with the Product Response File ID
Replace the FILE value with the DB2 installation folder
PROD = DB2_SERVER_EDITION
FILE = /opt/ibm/db2/V10.5
LIC_AGREEMENT = ACCEPT
INSTALL_TYPE = CUSTOM
COMP = APPLICATION_DEVELOPMENT_TOOLS
Stop DB2 with db2stop or db2stop force
Run db2setup with the response code
cd /opt/ibm/fixpack/universal/
./db2setup -r /opt/ibm/fixpack/devtools.resp
Start DB2 with dbstart
When you are done, run pecl install ibm_db2
Use /home/db2inst1/sqllib as your install directory.
Original instructions were found here to install them into an existing DB2 installation (I used the 3rd option):
http://db2commerce.com/2014/02/11/installing-a-db2-component-after-the-rest-of-db2-is-installed/
I got solution for the above issue.
Need to select Custom Install while installing db2. So I just uninstalled and reinstalled DB2.
After that It works fine for me. Thanks everyone :)

installing zend framework

I am running ubuntu hardy
I installed zend framework using : sudo apt-get install zend-framework command
Why did it not install zf.sh ?
I want to be able to use the zend_tool using cli.
How do I go about getting the zf.sh command to work?
Try sudo apt-get install zendframework-bin. The description for zendframework-bin is "binary scripts for zendframework". So this might be what you need to install.
to use zf.sh you should create an alias for that
like this ..
alias zf='/home/kanishka/workspace/zend/bin/zf.sh'
after that you can use zf in command line
now this should work :- zf create project test ,