1

I downloaded the latest stable php 7 release. installed all dependencies then:

 ./buildconf
./configure \
    --prefix=$HOME/php7/usr \
    --with-config-file-path=$HOME/php7/usr/etc \
    --enable-mbstring \
    --enable-zip \
    --enable-bcmath \
    --enable-pcntl \
    --enable-ftp \
    --enable-exif \
    --enable-calendar \
    --enable-sysvmsg \
    --enable-sysvsem \
    --enable-sysvshm \
    --enable-wddx \
    --with-curl \
    --with-mcrypt \
    --with-iconv \
    --with-gmp \
    --with-pspell \
    --with-gd \
    --with-jpeg-dir=/usr \
    --with-png-dir=/usr \
    --with-zlib-dir=/usr \
    --with-xpm-dir=/usr \
    --with-freetype-dir=/usr \
    --with-t1lib=/usr \
    --enable-gd-native-ttf \
    --enable-gd-jis-conv \
    --with-openssl \
    --with-mysql=/usr \
    --with-pdo-mysql=/usr \
    --with-gettext=/usr \
    --with-zlib=/usr \
    --with-bz2=/usr \
    --with-recode=/usr \
    --with-mysqli=/usr/bin/mysql_config

after that I ran sudo make ,sudo make test then sudo make install. all went well. I think I am missing a few steps when I do php -v. it says command not found So I went to the install folder /opt/php-7.0.0/bin and tried ./php -v this returns :

PHP 7.0.0 (cli) (built: Dec 11 2015 16:38:27) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies

what else do I need to do ? any help is greatly appreciated.

Abel
  • 21
  • 1
  • 1
  • 3

1 Answers1

2

You need to add /opt/php-7.0.0/bin to your path.

$export PATH=/opt/php-7.0.0/bin:$PATH
That will change it for the current shell.

To make these changes permanent, add the command above to the end of your ~/.bash_profile file.

Eddie Dunn
  • 463
  • 2
  • 9
  • -bash: PATH=/opt/php-7.0.0/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:/home/ec2-user/.local/bin:/home/ec2-user/bin: No such file or directory and the folder does exist – Abel Dec 11 '15 at 18:10
  • 1
    The `$` is for the prompt you don't type it in. – Eddie Dunn Dec 11 '15 at 18:12