Đã hoàn thành

Compile PHP static binary

I need a static PHP binary that has:

- PHP 7

- mysqli

- json

- OpenCV for PHP

The OpenCV installation instructions for PHP can be found here, along with some examples.

[login to view URL]

[login to view URL]

I have attempted it myself, and ALMOST succeeded, but could not get the OpenCV extension to go into the static PHP binary.

Here are my commands for the compile, on a Ubuntu 18.04 instance from Amazon.

# Directory for compile

cd ~

mkdir ~/php-7-bin

# Update packages and install needed compilation dependencies

sudo apt-get install build-essential

sudo apt install -y autoconf automake make make-guile bison build-essential curl flex libtool libssl-dev libcurl4-openssl-dev libxml2-dev libreadline7 libreadline-dev libsqlite3-dev nginx pkg-config re2c sqlite3 zlib1g-dev php7.2-mysql

sudo apt-get install libxml2-dev bzip2

sudo apt-get install libldap2-dev libldap-2.4-2 libtool-bin libzip-dev lbzip2 libxml2-dev bzip2 re2c libbz2-dev apache2-dev libjpeg-dev libxpm-dev libxpm-dev libgmp-dev libgmp3-dev libmcrypt-dev libmysqlclient-dev mysql-server mysql-common libpspell-dev librecode-dev libcurl4-openssl-dev libxft-dev

# if error, run:

sudo apt-get update

sudo apt update

#sudo apt-get install php7.2

# OpenCV

sudo apt install -y pkg-config cmake git php-cli php-dev

git clone [login to view URL]

git clone [login to view URL]

cd opencv_contrib && git checkout tags/4.0.1 && cd ../opencv && git checkout tags/4.0.1

cd .. && mkdir build && cd build

sudo cmake -D OPENCV_GENERATE_PKGCONFIG=YES -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D OPENCV_EXTRA_MODULES_PATH=../opencv_contrib/modules ../opencv

sudo make -j2

sudo make install

ldconfig

cd ~

git clone [login to view URL]

cd php-opencv

sudo phpize

./configure --with-php-config=/usr/bin/php-config

sudo make

sudo make install

# Do I need to do this step? Or can I add the extension direct to the PHP binary?

sudo echo "extension=[login to view URL]" > /etc/php/7.2/cli/conf.d/[login to view URL]

# Compile OpenSSL v1.0.1 from source,

# as Amazon Linux uses a newer version than the Lambda Execution Environment, which

# would otherwise produce an incompatible binary.

cd ~

curl -sL [login to view URL] | tar -xvz

cd openssl-1.0.1k

./config && make && sudo make install

# Download the PHP 7.3.0 source

cd ~

curl -sL [login to view URL]| tar -xvz

cd php-7.3.6

# Compile PHP with OpenSSL 1.0.1 support, and install to /home/ec2-user/php-7-bin

#./configure --prefix=/home/ec2-user/php-7-bin/ --without-pear --enable-mysqlnd --with-pdo-mysql --with-pdo-mysql=mysqlnd --enable-shared=no --enable-static=yes --enable-phar --with-openssl --with-curl --enable-libxml --enable-simplexml --enable-xml --with-mhash --enable-mbstring --enable-sockets --with-mysqli --with-bz2 --enable-zip --with-gd --with-jpeg-dir --enable-exif --with-freetype-dir --with-png-dir --without-libzip --with-zlib --with-zlib-dir --with-opencv

# TRIMMED VERSION because too many errors during configure, however the full version above could be tried because I used apt-get to add a bunch of new dependencies, but never tried the full configure command with those new dependencies.

# if already run a ./configure, remove it using this:

# rm configure && ./buildconf --force

./buildconf --force

./configure --prefix=/home/ec2-user/php-7-bin/ --without-pear --enable-mysqlnd --with-pdo-mysql --with-pdo-mysql=mysqlnd --with-zlib-dir --enable-mbstring --with-libxml-dir --with-gd --enable-exif --with-pdo-mysql --with-mysqli --with-jpeg-dir --with-png-dir --enable-shared --enable-php-opencv

sudo make

sudo make install

# check the result

cd /home/ec2-user/php-7-bin/bin

ls

# check which modules are installed

./php -m

Kĩ năng: Linux, Ubuntu

Xem nhiều hơn: install php mysql windows 2003 server, tringme server type, static nat router server, php script save attachment server, flash php file upload working server, chess php multi player chess server, build php script query game server, ajax php mysql constant check server, static nat cisco server, php excel output sql server, compile php cgi mssql, php script split files server, cisco static nat web server, asp php sql best rated server, godaddy linux server type, build php static pages, litespeed web server compile php, php static type checker

Về Bên Thuê:
( 104 nhận xét ) North Ward, Australia

ID dự án: #19924251

Được trao cho:

jrobinsonworks

I have been using Ubuntu ever since 16.10 and I have learned almost everything about the OS. I could help you get your PHP binary compiled and working.

$45 AUD trong 7 ngày
(0 Đánh Giá)
0.0

6 freelancer đang chào giá trung bình $84 cho công việc này

debianguy

Hi. Do you need a php compiled with opencv statically? I can help you without problems. Open to questions

$35 AUD trong 1 ngày
(46 Nhận xét)
4.9
Pro4Magento

Good Day. Can help You properly compile and setup this static library for php, which you need. Can be done within short time frame. Tnx and Regards.

$50 AUD trong 1 ngày
(27 Nhận xét)
4.1
NitinSharmabot

⭐Let's discuss ⭐ I 'm a Full-stack developer and Ethical Hacker Working +5 years in programming field. I love programming. My passion is to solve the programming issue. Technology Summary : ---Programming/Languages: PH Thêm

$40 AUD trong 1 ngày
(3 Nhận xét)
1.7
android2014213

I am experienced in compiling various module in Linux and php with extension. I have 8 years of experience as a Linux System Administrator. I posses good knowledge of mail server like zimbra, sendmail, web server li Thêm

$111 AUD trong 2 ngày
(5 Nhận xét)
2.1
khoadeveloper

Hi, As a full stack web developer, I have an experience of 12+ years in PHP, Javascritp, and PHP extension (c++). Here are some of my experience using nodejs, expressjs, and laravel. - [login to view URL] (nodejs, Thêm

$222 AUD trong 3 ngày
(0 Nhận xét)
0.0