Skip to content

Commit 5abef53

Browse files
committed
Update docs
1 parent 45fb80b commit 5abef53

File tree

2 files changed

+33
-25
lines changed

2 files changed

+33
-25
lines changed

β€Ždocs/differences.mdβ€Ž

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,17 @@ build system:
8282
* Installation
8383

8484
* The installation include directory (`/usr/local/include/php`) can be
85-
adjusted with the `PHP_INCLUDE_PREFIX` variable to support multiple PHP
86-
versions. For example, `/usr/local/include/php/8.4`.
85+
adjusted with the `PHP_INCLUDE_PREFIX` CMake cache variable to support
86+
multiple PHP versions. For example, `/usr/local/include/php/8.4`.
8787

8888
* The PHP Autotools layout configuration option `--with-layout=[PHP|GNU]` is
8989
in CMake removed and not implemented in favor of the GNU standard directory
9090
layout.
9191

92+
* PEAR installation writes less dot and temporary files outside of the staging
93+
installation directory (INSTALL_ROOT/DESTDIR). PEAR temporary directory can
94+
be adjusted with the `PHP_PEAR_TEMP_DIR` CMake cache variable.
95+
9296
## Bugs fixed
9397

9498
* Building inside folder with spaces.

β€Ždocs/php-installation.mdβ€Ž

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ only those relevant to PHP are listed:
8989
Default: `EPREFIX/lib`
9090
* `--includedir=DIR` - set the project C header files location;
9191
Default: `PREFIX/include`
92-
* `--datarootdir=DIR` - set read-only arch.-independent data root;
92+
* `--datarootdir=DIR` - set read-only architecture-independent data root;
9393
Default: `PREFIX/share`
9494
* `--datadir=DIR` - set read-only architecture-independent data location;
9595
Default: `DATAROOTDIR`
@@ -125,6 +125,7 @@ Common practice is to also add program prefix and suffix (for example, to have
125125
PHP_EXTRA_VERSION="-acme" \
126126
EXTENSION_DIR=/path/to/php/extensions \
127127
--with-layout=GNU \
128+
--with-pear=\${datadir}/pear \
128129
--localstatedir=/var \
129130
--sysconfdir=/etc \
130131
--program-suffix=84 \
@@ -136,13 +137,13 @@ See `./configure --help` for more information on how to adjust these locations.
136137
Default PHP Autotools directory structure with GNU layout (`--with-layout=GNU`):
137138

138139
```sh
139-
πŸ“‚ <INSTALL_ROOT> # πŸ“‚ # Stage directory
140+
πŸ“¦ <INSTALL_ROOT> # πŸ“¦ # Stage directory
140141
β””β”€πŸ“‚ ${prefix} # β””β”€πŸ“‚ /usr/local # Installation prefix
141142
β”œβ”€πŸ“‚ ${bindir} # β”œβ”€πŸ“‚ bin # Executable binary directory
142143
β””β”€πŸ“‚ ${sysconfdir} # β””β”€πŸ“‚ etc # System configuration directory
143144
β”œβ”€πŸ“‚ php-fpm.d # β”œβ”€πŸ“‚ php-fpm.d # PHP FPM configuration directory
144-
β”œβ”€πŸ“„ php-fpm.conf.default # β”œβ”€πŸ“„ php-fpm.conf.default # PHP FPM configuration
145-
β””β”€πŸ“„ pear.conf # β””β”€πŸ“„ pear.conf # PEAR configuration file
145+
β”œβ”€πŸ“„ pear.conf # β”œβ”€πŸ“„ pear.conf # PEAR configuration file
146+
β””β”€πŸ“„ php-fpm.conf.default # β””β”€πŸ“„ php-fpm.conf.default # PHP FPM configuration
146147
β””β”€πŸ“‚ ${includedir} # β””β”€πŸ“‚ include # System include directory
147148
β””β”€πŸ“‚ php # β””β”€πŸ“‚ php # PHP headers
148149
β”œβ”€πŸ“‚ ext # β”œβ”€πŸ“‚ ext # PHP extensions header files
@@ -151,39 +152,40 @@ Default PHP Autotools directory structure with GNU layout (`--with-layout=GNU`):
151152
β”œβ”€πŸ“‚ TSRM # β”œβ”€πŸ“‚ TSRM # PHP TSRM header files
152153
β””β”€πŸ“‚ Zend # β””β”€πŸ“‚ Zend # Zend engine header files
153154
β””β”€πŸ“‚ ${libdir} # β””β”€πŸ“‚ lib
154-
β””β”€πŸ“‚ php # β””β”€πŸ“‚ php # PHP shared libraries and other build files, PEAR files
155+
β””β”€πŸ“‚ php # β””β”€πŸ“‚ php # PHP shared libraries, build files, PEAR
155156
β”œβ”€πŸ“‚ 20230901-zts-debug # β”œβ”€πŸ“‚ 20230901-zts-debug # PHP shared extensions (*.so files)
156157
β””β”€πŸ“‚ build # β””β”€πŸ“‚ build # Various PHP development and build files
157158
β”œβ”€πŸ“‚ ${sbindir} # β”œβ”€πŸ“‚ sbin # Executable binaries for root privileges
158159
β””β”€πŸ“‚ ${datarootdir} # β””β”€πŸ“‚ share # Directory with shareable files
159160
β””β”€πŸ“‚ ${mandir} # β””β”€πŸ“‚ man
160-
β”œβ”€πŸ“‚ man1 # β””β”€πŸ“‚ man1 # PHP man section 1 pages for *nix systems
161+
β”œβ”€πŸ“‚ man1 # β”œβ”€πŸ“‚ man1 # PHP man section 1 pages for *nix systems
161162
β””β”€πŸ“‚ man8 # β””β”€πŸ“‚ man8 # PHP man section 8 pages for *nix systems
162-
β”œβ”€πŸ“‚ pear # β””β”€πŸ“‚ pear # PEAR installation directory
163+
β”œβ”€πŸ“‚ ${PHP_PEAR} # β”œβ”€πŸ“‚ pear # PEAR installation directory
163164
β””β”€πŸ“‚ php # β””β”€πŸ“‚ php
164165
β””β”€πŸ“‚ fpm # β””β”€πŸ“‚ fpm # Additional FPM static HTML files
165166
β””β”€πŸ“‚ ${localstatedir} # β””β”€πŸ“‚ var # The Linux var directory
166167
β””β”€πŸ“‚ log # β””β”€πŸ“‚ log # Directory for PHP logs
167168
β””β”€πŸ“‚ ${runstatedir} # β””β”€πŸ“‚ var/run # Runtime data directory
168-
πŸ“‚ /tmp # πŸ“‚ /tmp # System temporary directory
169-
β””β”€πŸ“‚ pear # β””β”€πŸ“‚ pear # PEAR writes temporary files here
170-
β”œβ”€πŸ“‚ cache # β”œβ”€πŸ“‚ cache
171-
β”œβ”€πŸ“‚ download # β”œβ”€πŸ“‚ download
172-
β””β”€πŸ“‚ temp # β””β”€πŸ“‚ temp
169+
πŸ“¦ / # πŸ“¦ / # System top level root directory
170+
β””β”€πŸ“‚ tmp # β””β”€πŸ“‚ tmp # System temporary directory
171+
β””β”€πŸ“‚ pear # β””β”€πŸ“‚ pear # PEAR temporary directory
172+
β”œβ”€πŸ“‚ cache # β”œβ”€πŸ“‚ cache
173+
β”œβ”€πŸ“‚ download # β”œβ”€πŸ“‚ download
174+
β””β”€πŸ“‚ temp # β””β”€πŸ“‚ temp
173175
```
174176

175177
This is how the default PHP layout directory structure looks like
176178
(`--with-layout=PHP`). Notice the difference of the shared extensions directory
177179
and the `share` directory being named `php`:
178180

179181
```sh
180-
πŸ“‚ <INSTALL_ROOT>
182+
πŸ“¦ <INSTALL_ROOT>
181183
β””β”€πŸ“‚ /usr/local
182184
β”œβ”€πŸ“‚ bin
183185
β””β”€πŸ“‚ etc
184186
β”œβ”€πŸ“‚ php-fpm.d
185-
β”œβ”€πŸ“„ php-fpm.conf.default
186-
β””β”€πŸ“„ pear.conf
187+
β”œβ”€πŸ“„ pear.conf
188+
β””β”€πŸ“„ php-fpm.conf.default
187189
β””β”€πŸ“‚ include
188190
β””β”€πŸ“‚ php
189191
β”œβ”€πŸ“‚ ext
@@ -206,9 +208,10 @@ and the `share` directory being named `php`:
206208
β””β”€πŸ“‚ var
207209
β”œβ”€πŸ“‚ log
208210
β””β”€πŸ“‚ run
209-
πŸ“‚ /tmp
210-
β””β”€πŸ“‚ pear
211-
β””β”€πŸ“‚ temp
211+
πŸ“¦ /
212+
β””β”€πŸ“‚ tmp
213+
β””β”€πŸ“‚ pear
214+
β””β”€πŸ“‚ temp
212215
```
213216

214217
## Installing PHP with CMake
@@ -247,7 +250,8 @@ DESTDIR=/stage cmake --install . --prefix /usr
247250
> Autotools-based build system.
248251
249252
* `CMAKE_INSTALL_PREFIX` - absolute path where to install the application;
250-
Windows default: `C:/Program Files`, elsewhere default: `/usr/local`
253+
\*nix default: `/usr/local`, Windows default:
254+
`C:/Program Files/${PROJECT_NAME}`
251255

252256
To adjust the installation locations, the
253257
[GNUInstallDirs](https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html)
@@ -287,7 +291,7 @@ prefix will not be taken into account.
287291

288292
PHP CMake-based build system specific installation cache variables:
289293

290-
* `PHP_INCLUDE_PREFIX` - To set the PHP include directory inside the
294+
* `PHP_INCLUDE_PREFIX` - the PHP include directory inside the
291295
`CMAKE_INSTALL_INCLUDEDIR`;
292296
Default: `php`
293297
* `PHP_PEAR_TEMP_DIR` - path where PEAR writes temporary files;
@@ -302,13 +306,13 @@ PHP CMake-based build system specific installation cache variables:
302306
PHP installation directory structure when using CMake:
303307

304308
```sh
305-
πŸ“‚ $ENV{DESTDIR} # πŸ“‚
309+
πŸ“¦ $ENV{DESTDIR} # πŸ“¦
306310
β””β”€πŸ“‚ ${CMAKE_INSTALL_PREFIX} # β””β”€πŸ“‚ /usr/local (Windows: C:/Program Files/${PROJECT_NAME})
307311
β”œβ”€πŸ“‚ ${CMAKE_INSTALL_BINDIR} # β”œβ”€πŸ“‚ bin
308312
β””β”€πŸ“‚ ${CMAKE_INSTALL_SYSCONFDIR} # β””β”€πŸ“‚ etc
309313
β”œβ”€πŸ“‚ php-fpm.d # β”œβ”€πŸ“‚ php-fpm.d
310-
β”œβ”€πŸ“„ php-fpm.conf.default # β”œβ”€πŸ“„ php-fpm.conf.default
311-
β””β”€πŸ“„ pear.conf # β””β”€πŸ“„ pear.conf
314+
β”œβ”€πŸ“„ pear.conf # β”œβ”€πŸ“„ pear.conf
315+
β””β”€πŸ“„ php-fpm.conf.default # β””β”€πŸ“„ php-fpm.conf.default
312316
β””β”€πŸ“‚ ${CMAKE_INSTALL_INCLUDEDIR} # β””β”€πŸ“‚ include
313317
β””β”€πŸ“‚ ${PHP_INCLUDE_PREFIX} # β””β”€πŸ“‚ php
314318
β”œβ”€πŸ“‚ ext # β”œβ”€πŸ“‚ ext

0 commit comments

Comments
Β (0)