forked from rubens-shoji/scripts-ubuntu
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-pcntl.bash
More file actions
executable file
·68 lines (49 loc) · 1019 Bytes
/
install-pcntl.bash
File metadata and controls
executable file
·68 lines (49 loc) · 1019 Bytes
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
#
# Script para a habilitação do módulo pcntl do php
#
#execute automatic with sudo
sudo -v
if [ "$EUID" -ne 0 ]
then echo "Rode com sudo, ou como root"
exit
fi
TMP=/tmp/phpsource
PHP_MODULE_INI=/etc/php5/mods-available/pcntl.ini
echo "Creating temp dirs"
if [ ! -d $TMP ]; then
mkdir $TMP
fi
cd $TMP
if [ ! -d $TMP/php5* ]; then
echo "Getting the php source"
apt-get source php5
else
echo "Already has the source"
fi
cd $TMP/php5-*/ext/pcntl
echo "Phpizing..."
phpize
echo "Configuring..."
./configure
echo "Making..."
make
echo "Installing module"
if [ ! -e $PHP_MODULE_BIN ]; then
cd modules
cp pcntl.so /usr/lib/php5/20131106/pcntl.so
else
echo "Already has compiled lib"
fi
if [ ! -e $PHP_MODULE_INI ]; then
echo "extension=pcntl.so" > $PHP_MODULE_INI
else
echo "Already has $PHP_MODULE_INI"
fi
echo "Enabling module"
php5enmod pcntl
echo "Restart fpm"
# CHANGE THIS IF USING mod_php
service php5-fpm restart
echo "Cleaning..."
rm -Rf $TMP