Skip to content

Commit

Permalink
Update 'build-php.sh' script to build without extensions (#221).
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cztomczak committed Feb 8, 2019
1 parent 62d2f41 commit 66b8927
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 3 deletions.
34 changes: 34 additions & 0 deletions build-php-with-ext.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/bin/bash

# This script builds with PHP extensions enabled: mysqli and pgsql.
# To build with postgresql support you need to install dependency:
# >> sudo apt-get install libpq-dev
# And later when distributing app you have to make sure that 'libpq5'
# package is installed on end user machine.

# READ ME:
# - Tested on Ubuntu 14.04 64-bit.
# - Before running script download sources from http://php.net/downloads.php
# and extract them to "build/php*/" directory (create build/ directory).

# Exit immediately if a command exits with a non-zero status.
set -e

# Print all executed commands to terminal.
# set -x

root_dir=$(dirname $0)
cd ${root_dir}/build/php*/
php_dir=$(pwd)
echo "Found PHP: ${php_dir}"
echo "Configure PHP..."
./configure \
--prefix=${php_dir}/dist-install \
--exec-prefix=${php_dir}/dist-install-exec-prefix \
--with-mysqli \
--with-pgsql=/usr/include/postgresql
echo "Build PHP..."
make
echo "Copy php-cgi to build/bin/"
cp sapi/cgi/php-cgi ../bin/
echo "OK completed."
4 changes: 1 addition & 3 deletions build-php.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ echo "Found PHP: ${php_dir}"
echo "Configure PHP..."
./configure \
--prefix=${php_dir}/dist-install \
--exec-prefix=${php_dir}/dist-install-exec-prefix \
--with-mysqli \
--with-pgsql=/usr/include/postgresql
--exec-prefix=${php_dir}/dist-install-exec-prefix
echo "Build PHP..."
make
echo "Copy php-cgi to build/bin/"
Expand Down

0 comments on commit 66b8927

Please sign in to comment.