-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
vagrant-php.sh
49 lines (36 loc) · 1.07 KB
/
vagrant-php.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/bin/bash
PHP_VERSION=8.0.3
sudo apt-get update
sudo apt-get install git gcc make pkg-config autoconf bison libxml2-dev libssl-dev curl -y
# Install PHP:
sudo mkdir /usr/local/php
cd /usr/local/php
sudo mkdir cli
sudo mkdir php-src
sudo curl -LSs https://github.com/php/php-src/archive/php-$PHP_VERSION.tar.gz | sudo tar -xz -C "php-src" --strip-components 1
pushd php-src
sudo ./buildconf --force
sudo ./configure \
--prefix=/usr/local/php/cli \
--with-config-file-path=/usr/local/php/cli \
--enable-maintainer-zts \
--enable-debug \
--enable-pcntl \
--enable-opcache \
--enable-sockets
sudo make -j4
sudo make install
popd
sudo touch /usr/local/php/cli/php.ini
sudo chmod 466 /usr/local/php/cli/php.ini
sudo ln -s /usr/local/php/cli/bin/php /usr/local/bin/php
sudo ln -s /usr/local/php/cli/bin/phpize /usr/local/bin/phpize
sudo ln -s /usr/local/php/cli/bin/php-config /usr/local/bin/php-config
cd /vagrant
sudo phpize --clean
sudo phpize
sudo ./configure
sudo make install
sudo echo "extension=\"fiber.so\"" >> /usr/local/php/cli/php.ini
php -v
php -m