Skip to content

Commit 093aba2

Browse files
committed
Merge branch 'PHP-8.5'
2 parents 2e49175 + 0bedd4c commit 093aba2

File tree

5 files changed

+80
-8
lines changed

5 files changed

+80
-8
lines changed

cmake/ext/skeleton/CMakeLists.txt.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ install(
121121
COMPONENT php-development
122122
)
123123

124-
set(PHP_EXTENSION_%EXTNAMECAPS% TRUE)
124+
set(PHP_EXT_%EXTNAMECAPS%_ENABLED TRUE)
125125

126126
# Create configuration header.
127127
configure_file(cmake/config.h.in config.h)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
/* Define to 1 if the PHP extension '%EXTNAME%' is available. */
2-
#cmakedefine PHP_EXTENSION_%EXTNAMECAPS% 1
2+
#cmakedefine PHP_EXT_%EXTNAMECAPS%_ENABLED 1

cmake/sapi/apache2handler/CMakeLists.txt

Lines changed: 45 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,25 @@
33
44
Configure the `apache2handler` PHP SAPI.
55
6-
## PHP_SAPI_APACHE2HANDLER
6+
## Configuration options
7+
8+
### PHP_SAPI_APACHE2HANDLER
79
810
* Default: `OFF`
911
* Values: `ON|OFF`
1012
1113
Enable the shared Apache 2 handler SAPI module.
1214
15+
## PHP_SAPI_APACHE2HANDLER_INSTALL_DIR
16+
17+
* Default: The path to the Apache modules directory of the host system
18+
(`Apache_LIBEXEC`).
19+
20+
The path where to install the PHP Apache module (`mod_php.so`). Relative path is
21+
interpreted as being relative to the installation prefix `CMAKE_INSTALL_PREFIX`.
22+
23+
## About
24+
1325
Loadable via Apache's Dynamic Shared Object (DSO) support. If Apache will use
1426
PHP together with one of the threaded Multi-Processing Modules (MPMs), PHP must
1527
be configured and built with `PHP_THREAD_SAFETY` set to `ON`. Thread safety will
@@ -21,11 +33,24 @@ with the `APACHE_ROOT` and `Apache_APXS_EXECUTABLE` variables.
2133
2234
For example:
2335
24-
```cmake
36+
```sh
2537
cmake -B php-build -DPHP_SAPI_APACHE2HANDLER=ON -DAPACHE_ROOT=/opt/apache2
2638
# or
2739
cmake -B php-build -DPHP_SAPI_APACHE2HANDLER=ON -DApache_EXECUTABLE=/opt/apache2/bin/apxs
2840
```
41+
42+
The path, where to install the PHP Apache module, can be overridden with the
43+
`PHP_SAPI_APACHE2HANDLER_INSTALL_DIR` variable. This might be used in edge cases
44+
where some specific custom installation prefix is used to avoid insuficcient
45+
permissions of the default location on the host, or when developing the PHP
46+
build system.
47+
48+
```sh
49+
cmake \
50+
-B <build-dir> \
51+
-DPHP_SAPI_APACHE2HANDLER=ON \
52+
-DPHP_SAPI_APACHE2HANDLER_INSTALL_DIR=/custom/path/to/lib/apache2/modules
53+
```
2954
#]=============================================================================]
3055

3156
include(FeatureSummary)
@@ -38,6 +63,15 @@ add_feature_info(
3863
"Apache HTTP server module"
3964
)
4065

66+
set(
67+
CACHE{PHP_SAPI_APACHE2HANDLER_INSTALL_DIR}
68+
TYPE STRING
69+
HELP "The path to the Apache modules directory to install PHP Apache module"
70+
VALUE ""
71+
)
72+
set_property(CACHE PHP_SAPI_APACHE2HANDLER_INSTALL_DIR PROPERTY TYPE PATH)
73+
mark_as_advanced(PHP_SAPI_APACHE2HANDLER_INSTALL_DIR)
74+
4175
if(NOT PHP_SAPI_APACHE2HANDLER)
4276
return()
4377
endif()
@@ -75,6 +109,13 @@ set_package_properties(
75109
PURPOSE "Necessary to enable the Apache PHP SAPI."
76110
)
77111

112+
if(Apache_FOUND AND NOT PHP_SAPI_APACHE2HANDLER_INSTALL_DIR)
113+
set_property(
114+
CACHE PHP_SAPI_APACHE2HANDLER_INSTALL_DIR
115+
PROPERTY VALUE "${Apache_LIBEXECDIR}"
116+
)
117+
endif()
118+
78119
target_link_libraries(
79120
php_sapi_apache2handler
80121
PRIVATE
@@ -146,9 +187,9 @@ endif()
146187
install(
147188
TARGETS php_sapi_apache2handler
148189
LIBRARY
149-
DESTINATION ${Apache_LIBEXECDIR}
190+
DESTINATION ${PHP_SAPI_APACHE2HANDLER_INSTALL_DIR}
150191
COMPONENT php-sapi-apache2handler
151192
RUNTIME
152-
DESTINATION ${Apache_LIBEXECDIR}
193+
DESTINATION ${PHP_SAPI_APACHE2HANDLER_INSTALL_DIR}
153194
COMPONENT php-sapi-apache2handler
154195
)

docs/cmake/configuration.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -811,6 +811,12 @@ A list of Autoconf `configure` command-line configuration options, Windows
811811
<td>N/A</td>
812812
<td>removed since PHP >= 8.4</td>
813813
</tr>
814+
<tr>
815+
<td>&emsp;N/A</td>
816+
<td>&emsp;N/A</td>
817+
<td></td>
818+
<td>PHP_SAPI_APACHE2HANDLER_INSTALL_DIR=&lt;dir&gt;</td>
819+
</tr>
814820
<tr>
815821
<td>--enable-cgi</td>
816822
<td>--enable-cgi</td>

docs/cmake/sapi/apache2handler.md

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,25 @@
55

66
Configure the `apache2handler` PHP SAPI.
77

8-
## PHP_SAPI_APACHE2HANDLER
8+
## Configuration options
9+
10+
### PHP_SAPI_APACHE2HANDLER
911

1012
* Default: `OFF`
1113
* Values: `ON|OFF`
1214

1315
Enable the shared Apache 2 handler SAPI module.
1416

17+
## PHP_SAPI_APACHE2HANDLER_INSTALL_DIR
18+
19+
* Default: The path to the Apache modules directory of the host system
20+
(`Apache_LIBEXEC`).
21+
22+
The path where to install the PHP Apache module (`mod_php.so`). Relative path is
23+
interpreted as being relative to the installation prefix `CMAKE_INSTALL_PREFIX`.
24+
25+
## About
26+
1527
Loadable via Apache's Dynamic Shared Object (DSO) support. If Apache will use
1628
PHP together with one of the threaded Multi-Processing Modules (MPMs), PHP must
1729
be configured and built with `PHP_THREAD_SAFETY` set to `ON`. Thread safety will
@@ -23,8 +35,21 @@ with the `APACHE_ROOT` and `Apache_APXS_EXECUTABLE` variables.
2335

2436
For example:
2537

26-
```cmake
38+
```sh
2739
cmake -B php-build -DPHP_SAPI_APACHE2HANDLER=ON -DAPACHE_ROOT=/opt/apache2
2840
# or
2941
cmake -B php-build -DPHP_SAPI_APACHE2HANDLER=ON -DApache_EXECUTABLE=/opt/apache2/bin/apxs
3042
```
43+
44+
The path, where to install the PHP Apache module, can be overridden with the
45+
`PHP_SAPI_APACHE2HANDLER_INSTALL_DIR` variable. This might be used in edge cases
46+
where some specific custom installation prefix is used to avoid insuficcient
47+
permissions of the default location on the host, or when developing the PHP
48+
build system.
49+
50+
```sh
51+
cmake \
52+
-B <build-dir> \
53+
-DPHP_SAPI_APACHE2HANDLER=ON \
54+
-DPHP_SAPI_APACHE2HANDLER_INSTALL_DIR=/custom/path/to/lib/apache2/modules
55+
```

0 commit comments

Comments
 (0)