Skip to content

Commit 66b8927

Browse files
committed
Update 'build-php.sh' script to build without extensions (#221).
Add new 'build-php-with-ext.sh' script that builds PHP with mysqli and pgsql extensions support. Note that pgsql extension has a dependency 'libpq5' that has to be installed on end user machine. Shipping both 'php-cgi' and 'php-cgi-mysqli-pgsql' PHP binaries with PHP Desktop releases.
1 parent 62d2f41 commit 66b8927

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

build-php-with-ext.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
# This script builds with PHP extensions enabled: mysqli and pgsql.
4+
# To build with postgresql support you need to install dependency:
5+
# >> sudo apt-get install libpq-dev
6+
# And later when distributing app you have to make sure that 'libpq5'
7+
# package is installed on end user machine.
8+
9+
# READ ME:
10+
# - Tested on Ubuntu 14.04 64-bit.
11+
# - Before running script download sources from http://php.net/downloads.php
12+
# and extract them to "build/php*/" directory (create build/ directory).
13+
14+
# Exit immediately if a command exits with a non-zero status.
15+
set -e
16+
17+
# Print all executed commands to terminal.
18+
# set -x
19+
20+
root_dir=$(dirname $0)
21+
cd ${root_dir}/build/php*/
22+
php_dir=$(pwd)
23+
echo "Found PHP: ${php_dir}"
24+
echo "Configure PHP..."
25+
./configure \
26+
--prefix=${php_dir}/dist-install \
27+
--exec-prefix=${php_dir}/dist-install-exec-prefix \
28+
--with-mysqli \
29+
--with-pgsql=/usr/include/postgresql
30+
echo "Build PHP..."
31+
make
32+
echo "Copy php-cgi to build/bin/"
33+
cp sapi/cgi/php-cgi ../bin/
34+
echo "OK completed."

build-php.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,7 @@ echo "Found PHP: ${php_dir}"
1919
echo "Configure PHP..."
2020
./configure \
2121
--prefix=${php_dir}/dist-install \
22-
--exec-prefix=${php_dir}/dist-install-exec-prefix \
23-
--with-mysqli \
24-
--with-pgsql=/usr/include/postgresql
22+
--exec-prefix=${php_dir}/dist-install-exec-prefix
2523
echo "Build PHP..."
2624
make
2725
echo "Copy php-cgi to build/bin/"

0 commit comments

Comments
 (0)