Skip to content

Commit 126c96f

Browse files
committed
added php8.1 support
1 parent a161a77 commit 126c96f

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed

php8.1-compile.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# PHP
2+
3+
## Install PHP from souce
4+
5+
### dependencies for php and extensions
6+
sudo apt-get install postgresql-server-dev-11 bison libreadline-dev git build-essential autoconf automake libtool re2c libxml2-dev libcurl4-openssl-dev libssl-dev libbz2-dev libjpeg-dev libpng-dev libxpm-dev libfreetype6-dev libzip-dev libsqlite3-dev libonig-dev libxslt1-dev
7+
8+
### clone souce
9+
git clone -b PHP-8.1.14 https://github.com/php/php-src.git PHP-8.1.14
10+
cd PHP-8.1.14
11+
12+
### build
13+
./buildconf --force
14+
15+
### configure
16+
./configure --prefix=/opt/php/php-8.1.14 --disable-cgi --disable-shared --enable-static --with-pgsql --with-pdo-mysql --with-pdo-pgsql --with-pgsql --with-ffi --with-readline --with-openssl --enable-soap --enable-sockets --with-bz2 --with-zlib --enable-mbstring --with-curl --with-xsl
17+
18+
### compile and install
19+
make -j 4 && sudo make install
20+
21+
22+
# PHP-CPP
23+
24+
## Create libphpcpp.so.2.3
25+
26+
### clone source
27+
git clone https://github.com/CopernicaMarketingSoftware/PHP-CPP.git
28+
cd PHP-GTK
29+
30+
### merge PR 497 for PHP 8.1 support
31+
git fetch origin pull/497/head:MASTER
32+
33+
edit PHP-CPP/Makefile to use /opt/php/php-8.1.14/bin/php-config
34+
35+
### compile and install
36+
make -j 4 && sudo make install
37+
38+
# PHP-GTK3
39+
40+
## Create php-gtk3.so php module
41+
42+
### get gtk dependencies
43+
sudo apt-get install pkg-config libgtk-3-dev libgladeui-dev libgtksourceview-3.0-dev libwnck-dev
44+
45+
### clone source
46+
git clone https://github.com/scorninpc/php-gtk3.git PHP-GTK3
47+
cd PHP-GTK3
48+
49+
edit PHP-GTK3/Makefile to use /opt/php/php-8.1.14/bin/php-config
50+
51+
### compile
52+
make -j 4
53+
54+
### test
55+
/opt/php/php-8.1.14/bin/php -dextension=./php-gtk3.so test1.php
56+
57+
# Make a script to run easily
58+
59+
## copy module to PHP
60+
sudo cp php-gtk3.so /opt/php/php-8.1.14/lib/php/extensions/no-debug-non-zts-20210902/php-gtk3.so
61+
62+
## create a script
63+
64+
`sudo nano /usr/bin/php-gtk3`
65+
66+
with content
67+
68+
```
69+
#!/bin/bash
70+
/opt/php/phpPHP-8.1.14/bin/php -dextension=php-gtk3.so $@
71+
```
72+
73+
make it executable
74+
`sudo chmod +x /usr/bin/php-gtk3`
75+
76+
done
77+
78+
`php-gtk3 test1.php`
79+
80+
# Create AppImage (just for my reference)
81+
82+
add libs to PHP in ./lib
83+
84+
- PHP
85+
libldap_r-2.4.so.2
86+
liblber-2.4.so.2
87+
libonig.so.5
88+
libffi.so.7
89+
libcrypto.so.1.1
90+
libssl.so.1.1
91+
92+
- PHP-GTK
93+
libphpcpp.so.2.3
94+
95+
`appimagetool-x86_64.AppImage php-gtk3.AppDir`

0 commit comments

Comments
 (0)