|
454 | 454 | exit 1 |
455 | 455 | elif [ -z "$CFLAGS" ]; then |
456 | 456 | if [ `getconf LONG_BIT` == "64" ]; then |
| 457 | + COMPILE_TARGET="linux64" |
457 | 458 | write_out "INFO" "Compiling for current machine using 64-bit" |
458 | 459 | if [ "$(uname -m)" != "aarch64" ]; then |
459 | 460 | CFLAGS="-m64 $CFLAGS" |
@@ -1152,6 +1153,32 @@ get_github_extension "arraydebug" "$EXT_ARRAYDEBUG_VERSION" "pmmp" "ext-arraydeb |
1152 | 1153 |
|
1153 | 1154 | get_github_extension "encoding" "$EXT_ENCODING_VERSION" "pmmp" "ext-encoding" |
1154 | 1155 |
|
| 1156 | +cafile="" |
| 1157 | +if [[ "$COMPILE_TARGET" == "mac"* ]]; then |
| 1158 | + cafile="/etc/ssl/cert.pem" |
| 1159 | +elif [[ "$COMPILE_TARGET" == "linux"* ]] && [[ "$IS_CROSSCOMPILE" != "yes" ]]; then |
| 1160 | + #try to detect the correct location from the current system |
| 1161 | + for file in \ |
| 1162 | + "$SSL_CERT_FILE" \ |
| 1163 | + "/etc/ssl/certs/ca-certificates.crt" \ |
| 1164 | + "/etc/pki/tls/certs/ca-bundle-crt" \ |
| 1165 | + "/etc/ssl/cert.pem"; |
| 1166 | + do |
| 1167 | + if [ -f "$file" ]; then |
| 1168 | + cafile="$file" |
| 1169 | + break |
| 1170 | + fi |
| 1171 | + done |
| 1172 | +else |
| 1173 | + echo "wtf $COMPILE_TARGET" |
| 1174 | +fi |
| 1175 | +if [ -z "$cafile" ]; then |
| 1176 | + write_out "WARNING" "Don't know where to find SSL CA bundle for this target; PHP code won't be able to safely access https:// links unless openssl.cafile is configured to the correct path in php.ini" |
| 1177 | +else |
| 1178 | + write_out "INFO" "System SSL CA bundle detected as $cafile; if this is not correct, please adjust openssl.cafile in php.ini" |
| 1179 | + |
| 1180 | +fi |
| 1181 | + |
1155 | 1182 | write_library "PHP" "$PHP_VERSION" |
1156 | 1183 |
|
1157 | 1184 | write_configure |
@@ -1357,6 +1384,9 @@ echo "error_reporting=-1" >> "$INSTALL_DIR/bin/php.ini" |
1357 | 1384 | echo "display_errors=1" >> "$INSTALL_DIR/bin/php.ini" |
1358 | 1385 | echo "display_startup_errors=1" >> "$INSTALL_DIR/bin/php.ini" |
1359 | 1386 | echo "recursionguard.enabled=0 ;disabled due to minor performance impact, only enable this if you need it for debugging" >> "$INSTALL_DIR/bin/php.ini" |
| 1387 | +if [ -n "$cafile" ]; then |
| 1388 | + echo "openssl.cafile=$cafile" >> "$INSTALL_DIR/bin/php.ini" |
| 1389 | +fi |
1360 | 1390 |
|
1361 | 1391 | if [ "$HAVE_OPCACHE" == "yes" ]; then |
1362 | 1392 | if [ "$PHP_VERSION_ID" -lt 80500 ]; then |
|
0 commit comments