Solved FreeBSD 12.1-Release + Apache/2.4.41 + PHP 7.4 (White Page Error)

Hello again everyone! Merry Christmas! :)

After getting PHP 7.4 extensions compiled correctly Apache set at it's default mpm_prefork I received a white page processing PHP. I then proceeded to follow a Digital Ocean guide here to setup and configure PHP-FPM (which is the type of configuration I was looking for).

After setting it up; I still am having difficulties processing PHP.

Here are my following logs at the moment:

Apache/2.4.41 - (the mpm_prefork:notice was prior to the configuration and reboot):
Code:
root@sharpenyoursword:/var/log # tail -f httpd-error.log
[Thu Dec 19 08:54:25.299972 2019] [core:notice] [pid 38691] AH00094: Command line: '/usr/local/sbin/httpd -D NOHTTPACCEPT'
[Fri Dec 20 13:47:08.288471 2019] [mpm_prefork:notice] [pid 38691] AH00169: caught SIGTERM, shutting down
[Fri Dec 20 13:47:08.409077 2019] [mpm_event:notice] [pid 20099:tid 34370666496] AH00489: Apache/2.4.41 (FreeBSD) configured -- resuming normal operations
[Fri Dec 20 13:47:08.409765 2019] [core:notice] [pid 20099:tid 34370666496] AH00094: Command line: '/usr/local/sbin/httpd -D NOHTTPACCEPT'
[Fri Dec 20 13:56:22.730946 2019] [mpm_event:notice] [pid 20099:tid 34370666496] AH00491: caught SIGTERM, shutting down
[Fri Dec 20 13:56:22.821000 2019] [mpm_event:notice] [pid 33126:tid 34370666496] AH00489: Apache/2.4.41 (FreeBSD) configured -- resuming normal operations
[Fri Dec 20 13:56:22.821442 2019] [core:notice] [pid 33126:tid 34370666496] AH00094: Command line: '/usr/local/sbin/httpd -D NOHTTPACCEPT'
[Fri Dec 20 13:56:39.228291 2019] [mpm_event:notice] [pid 33126:tid 34370666496] AH00491: caught SIGTERM, shutting down
[Fri Dec 20 13:59:25.214516 2019] [mpm_event:notice] [pid 76006:tid 34370666496] AH00489: Apache/2.4.41 (FreeBSD) configured -- resuming normal operations
[Fri Dec 20 13:59:25.216401 2019] [core:notice] [pid 76006:tid 34370666496] AH00094: Command line: '/usr/local/sbin/httpd -D NOHTTPACCEPT'
PHP-FPM log:
Code:
root@sharpenyoursword:/var/log # tail -f php-fpm.log
[20-Dec-2019 13:56:17] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful

[20-Dec-2019 13:56:17] NOTICE: fpm is running, pid 27745
[20-Dec-2019 13:56:17] NOTICE: ready to handle connections
[20-Dec-2019 13:56:43] NOTICE: Finishing ...
[20-Dec-2019 13:56:43] NOTICE: exiting, bye-bye!
[20-Dec-2019 13:59:21] NOTICE: configuration file /usr/local/etc/php-fpm.conf test is successful

[20-Dec-2019 13:59:21] NOTICE: fpm is running, pid 6246
[20-Dec-2019 13:59:21] NOTICE: ready to handle connections
Either way I was receiving a positive "It Works!" ; I am wondering if it has to do with PHP 7.4.

The CLI output for php -v is the following either way:
Code:
root@sharpenyoursword:/var/log # php -v
PHP 7.4.0 (cli) (built: Dec 14 2019 18:35:13) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.0, Copyright (c), by Zend Technologies
root@sharpenyoursword:/var/log #
Any pointers would be extremely helpful! Thanks a bunch everyone!
 
Last edited by a moderator:
This is sure a strange error. I have configured lots of Linux servers before and the /info.php is blank and generating 304 not modified. When I run php info.php from command line; all processes correctly. I doubled checked almost everything. The only thing that I am holding back on right now is re-compiling. I don't want to break the install as I feel it's a configuration issue I missed.
 
Code:
root@sharpenyoursword:/usr/local/etc/php # php -m
[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
filter
gd
hash
iconv
intl
json
libxml
mbstring
mysqli
mysqlnd
openssl
pcre
PDO
pdo_mysql
PDO_ODBC
pdo_pgsql
pdo_sqlite
pgsql
Phar
posix
Reflection
session
SimpleXML
sockets
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
Zend OPcache
zip
zlib

[Zend Modules]
Zend OPcache
 
Last edited by a moderator:
Code:
root@sharpenyoursword:/usr/local/etc/php # pkg info -l php74
php74-7.4.0:
    /usr/local/bin/php
    /usr/local/bin/php-cgi
    /usr/local/bin/php-config
    /usr/local/bin/phpdbg
    /usr/local/bin/phpize
    /usr/local/etc/php-fpm.conf.default
    /usr/local/etc/php-fpm.d/www.conf.default
    /usr/local/etc/php.conf
    /usr/local/etc/php.ini-development
    /usr/local/etc/php.ini-production
    /usr/local/etc/rc.d/php-fpm
    /usr/local/include/php/TSRM/TSRM.h
    /usr/local/include/php/TSRM/tsrm_win32.h
    /usr/local/include/php/Zend/zend.h
    /usr/local/include/php/Zend/zend_API.h
    /usr/local/include/php/Zend/zend_alloc.h
    /usr/local/include/php/Zend/zend_alloc_sizes.h
    /usr/local/include/php/Zend/zend_arena.h
    /usr/local/include/php/Zend/zend_ast.h
    /usr/local/include/php/Zend/zend_bitset.h
    /usr/local/include/php/Zend/zend_build.h
    /usr/local/include/php/Zend/zend_builtin_functions.h
    /usr/local/include/php/Zend/zend_closures.h
    /usr/local/include/php/Zend/zend_compile.h
    /usr/local/include/php/Zend/zend_config.h
    /usr/local/include/php/Zend/zend_config.w32.h
    /usr/local/include/php/Zend/zend_constants.h
    /usr/local/include/php/Zend/zend_cpuinfo.h
    /usr/local/include/php/Zend/zend_dtrace.h
    /usr/local/include/php/Zend/zend_dtrace_gen.h
    /usr/local/include/php/Zend/zend_errors.h
    /usr/local/include/php/Zend/zend_exceptions.h
    /usr/local/include/php/Zend/zend_execute.h
    /usr/local/include/php/Zend/zend_extensions.h
    /usr/local/include/php/Zend/zend_float.h
    /usr/local/include/php/Zend/zend_gc.h
    /usr/local/include/php/Zend/zend_generators.h
    /usr/local/include/php/Zend/zend_globals.h
    /usr/local/include/php/Zend/zend_globals_macros.h
    /usr/local/include/php/Zend/zend_hash.h
    /usr/local/include/php/Zend/zend_highlight.h
    /usr/local/include/php/Zend/zend_inheritance.h
    /usr/local/include/php/Zend/zend_ini.h
    /usr/local/include/php/Zend/zend_ini_parser.h
    /usr/local/include/php/Zend/zend_ini_scanner.h
    /usr/local/include/php/Zend/zend_ini_scanner_defs.h
    /usr/local/include/php/Zend/zend_interfaces.h
    /usr/local/include/php/Zend/zend_istdiostream.h
    /usr/local/include/php/Zend/zend_iterators.h
    /usr/local/include/php/Zend/zend_language_parser.h
    /usr/local/include/php/Zend/zend_language_scanner.h
    /usr/local/include/php/Zend/zend_language_scanner_defs.h
    /usr/local/include/php/Zend/zend_list.h
    /usr/local/include/php/Zend/zend_llist.h
    /usr/local/include/php/Zend/zend_long.h
    /usr/local/include/php/Zend/zend_map_ptr.h
    /usr/local/include/php/Zend/zend_modules.h
    /usr/local/include/php/Zend/zend_multibyte.h
    /usr/local/include/php/Zend/zend_multiply.h
    /usr/local/include/php/Zend/zend_object_handlers.h
    /usr/local/include/php/Zend/zend_objects.h
    /usr/local/include/php/Zend/zend_objects_API.h
    /usr/local/include/php/Zend/zend_operators.h
    /usr/local/include/php/Zend/zend_portability.h
    /usr/local/include/php/Zend/zend_ptr_stack.h
    /usr/local/include/php/Zend/zend_range_check.h
    /usr/local/include/php/Zend/zend_signal.h
    /usr/local/include/php/Zend/zend_smart_str.h
    /usr/local/include/php/Zend/zend_smart_str_public.h
    /usr/local/include/php/Zend/zend_smart_string.h
    /usr/local/include/php/Zend/zend_smart_string_public.h
    /usr/local/include/php/Zend/zend_sort.h
    /usr/local/include/php/Zend/zend_stack.h
    /usr/local/include/php/Zend/zend_stream.h
    /usr/local/include/php/Zend/zend_string.h
    /usr/local/include/php/Zend/zend_strtod.h
    /usr/local/include/php/Zend/zend_strtod_int.h
    /usr/local/include/php/Zend/zend_ts_hash.h
    /usr/local/include/php/Zend/zend_type_info.h
    /usr/local/include/php/Zend/zend_types.h
    /usr/local/include/php/Zend/zend_variables.h
    /usr/local/include/php/Zend/zend_virtual_cwd.h
    /usr/local/include/php/Zend/zend_vm.h
    /usr/local/include/php/Zend/zend_vm_def.h
    /usr/local/include/php/Zend/zend_vm_execute.h
    /usr/local/include/php/Zend/zend_vm_handlers.h
    /usr/local/include/php/Zend/zend_vm_opcodes.h
    /usr/local/include/php/Zend/zend_vm_trace_handlers.h
    /usr/local/include/php/Zend/zend_vm_trace_map.h
    /usr/local/include/php/Zend/zend_weakrefs.h
    /usr/local/include/php/ext/date/lib/timelib.h
    /usr/local/include/php/ext/date/lib/timelib_config.h
    /usr/local/include/php/ext/date/php_date.h
    /usr/local/include/php/ext/hash/php_hash.h
    /usr/local/include/php/ext/hash/php_hash_adler32.h
    /usr/local/include/php/ext/hash/php_hash_crc32.h
    /usr/local/include/php/ext/hash/php_hash_fnv.h
    /usr/local/include/php/ext/hash/php_hash_gost.h
    /usr/local/include/php/ext/hash/php_hash_haval.h
    /usr/local/include/php/ext/hash/php_hash_joaat.h
    /usr/local/include/php/ext/hash/php_hash_md.h
    /usr/local/include/php/ext/hash/php_hash_ripemd.h
    /usr/local/include/php/ext/hash/php_hash_sha.h
    /usr/local/include/php/ext/hash/php_hash_sha3.h
    /usr/local/include/php/ext/hash/php_hash_snefru.h
    /usr/local/include/php/ext/hash/php_hash_tiger.h
    /usr/local/include/php/ext/hash/php_hash_whirlpool.h
    /usr/local/include/php/ext/libxml/php_libxml.h
    /usr/local/include/php/ext/mysqlnd/config-win.h
    /usr/local/include/php/ext/mysqlnd/mysql_float_to_double.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_alloc.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_auth.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_block_alloc.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_charset.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_commands.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_connection.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_debug.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_enum_n_def.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_ext_plugin.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_libmysql_compat.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_plugin.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_portability.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_priv.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_protocol_frame_codec.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_ps.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_read_buffer.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_result.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_result_meta.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_reverse_api.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_statistics.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_structs.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_vio.h
    /usr/local/include/php/ext/mysqlnd/mysqlnd_wireprotocol.h
    /usr/local/include/php/ext/mysqlnd/php_mysqlnd.h
    /usr/local/include/php/ext/pcre/pcre2lib/config.h
    /usr/local/include/php/ext/pcre/pcre2lib/pcre2.h
    /usr/local/include/php/ext/pcre/pcre2lib/pcre2_internal.h
    /usr/local/include/php/ext/pcre/pcre2lib/pcre2_intmodedep.h
    /usr/local/include/php/ext/pcre/pcre2lib/pcre2_ucp.h
    /usr/local/include/php/ext/pcre/php_pcre.h
    /usr/local/include/php/ext/spl/php_spl.h
    /usr/local/include/php/ext/spl/spl_array.h
    /usr/local/include/php/ext/spl/spl_directory.h
    /usr/local/include/php/ext/spl/spl_dllist.h
    /usr/local/include/php/ext/spl/spl_engine.h
    /usr/local/include/php/ext/spl/spl_exceptions.h
    /usr/local/include/php/ext/spl/spl_fixedarray.h
    /usr/local/include/php/ext/spl/spl_functions.h
    /usr/local/include/php/ext/spl/spl_heap.h
    /usr/local/include/php/ext/spl/spl_iterators.h
    /usr/local/include/php/ext/spl/spl_observer.h
    /usr/local/include/php/ext/standard/base64.h
    /usr/local/include/php/ext/standard/basic_functions.h
    /usr/local/include/php/ext/standard/crc32.h
    /usr/local/include/php/ext/standard/credits.h
    /usr/local/include/php/ext/standard/credits_ext.h
    /usr/local/include/php/ext/standard/credits_sapi.h
    /usr/local/include/php/ext/standard/crypt_blowfish.h
    /usr/local/include/php/ext/standard/crypt_freesec.h
    /usr/local/include/php/ext/standard/css.h
    /usr/local/include/php/ext/standard/cyr_convert.h
    /usr/local/include/php/ext/standard/datetime.h
    /usr/local/include/php/ext/standard/dl.h
    /usr/local/include/php/ext/standard/exec.h
    /usr/local/include/php/ext/standard/file.h
    /usr/local/include/php/ext/standard/flock_compat.h
    /usr/local/include/php/ext/standard/fsock.h
    /usr/local/include/php/ext/standard/head.h
    /usr/local/include/php/ext/standard/hrtime.h
    /usr/local/include/php/ext/standard/html.h
    /usr/local/include/php/ext/standard/html_tables.h
    /usr/local/include/php/ext/standard/info.h
    /usr/local/include/php/ext/standard/md5.h
    /usr/local/include/php/ext/standard/microtime.h
    /usr/local/include/php/ext/standard/pack.h
    /usr/local/include/php/ext/standard/pageinfo.h
    /usr/local/include/php/ext/standard/php_array.h
    /usr/local/include/php/ext/standard/php_assert.h
    /usr/local/include/php/ext/standard/php_browscap.h
    /usr/local/include/php/ext/standard/php_crypt.h
    /usr/local/include/php/ext/standard/php_crypt_r.h
    /usr/local/include/php/ext/standard/php_dir.h
    /usr/local/include/php/ext/standard/php_dns.h
    /usr/local/include/php/ext/standard/php_ext_syslog.h
    /usr/local/include/php/ext/standard/php_filestat.h
    /usr/local/include/php/ext/standard/php_fopen_wrappers.h
    /usr/local/include/php/ext/standard/php_ftok.h
    /usr/local/include/php/ext/standard/php_http.h
    /usr/local/include/php/ext/standard/php_image.h
    /usr/local/include/php/ext/standard/php_incomplete_class.h
    /usr/local/include/php/ext/standard/php_iptc.h
    /usr/local/include/php/ext/standard/php_lcg.h
    /usr/local/include/php/ext/standard/php_link.h
    /usr/local/include/php/ext/standard/php_mail.h
    /usr/local/include/php/ext/standard/php_math.h
    /usr/local/include/php/ext/standard/php_metaphone.h
    /usr/local/include/php/ext/standard/php_mt_rand.h
    /usr/local/include/php/ext/standard/php_net.h
    /usr/local/include/php/ext/standard/php_password.h
    /usr/local/include/php/ext/standard/php_rand.h
    /usr/local/include/php/ext/standard/php_random.h
    /usr/local/include/php/ext/standard/php_smart_string.h
    /usr/local/include/php/ext/standard/php_smart_string_public.h
    /usr/local/include/php/ext/standard/php_standard.h
    /usr/local/include/php/ext/standard/php_string.h
    /usr/local/include/php/ext/standard/php_type.h
    /usr/local/include/php/ext/standard/php_uuencode.h
    /usr/local/include/php/ext/standard/php_var.h
    /usr/local/include/php/ext/standard/php_versioning.h
    /usr/local/include/php/ext/standard/proc_open.h
    /usr/local/include/php/ext/standard/quot_print.h
    /usr/local/include/php/ext/standard/scanf.h
    /usr/local/include/php/ext/standard/sha1.h
    /usr/local/include/php/ext/standard/streamsfuncs.h
    /usr/local/include/php/ext/standard/uniqid.h
    /usr/local/include/php/ext/standard/url.h
    /usr/local/include/php/ext/standard/url_scanner_ex.h
    /usr/local/include/php/ext/standard/winver.h
    /usr/local/include/php/main/SAPI.h
    /usr/local/include/php/main/build-defs.h
    /usr/local/include/php/main/fastcgi.h
    /usr/local/include/php/main/fopen_wrappers.h
    /usr/local/include/php/main/http_status_codes.h
    /usr/local/include/php/main/php.h
    /usr/local/include/php/main/php_compat.h
    /usr/local/include/php/main/php_config.h
    /usr/local/include/php/main/php_content_types.h
    /usr/local/include/php/main/php_getopt.h
    /usr/local/include/php/main/php_globals.h
    /usr/local/include/php/main/php_ini.h
    /usr/local/include/php/main/php_main.h
    /usr/local/include/php/main/php_memory_streams.h
    /usr/local/include/php/main/php_network.h
    /usr/local/include/php/main/php_open_temporary_file.h
    /usr/local/include/php/main/php_output.h
    /usr/local/include/php/main/php_reentrancy.h
    /usr/local/include/php/main/php_scandir.h
    /usr/local/include/php/main/php_stdint.h
    /usr/local/include/php/main/php_streams.h
    /usr/local/include/php/main/php_syslog.h
    /usr/local/include/php/main/php_ticks.h
    /usr/local/include/php/main/php_variables.h
    /usr/local/include/php/main/php_version.h
    /usr/local/include/php/main/rfc1867.h
    /usr/local/include/php/main/snprintf.h
    /usr/local/include/php/main/spprintf.h
    /usr/local/include/php/main/streams/php_stream_context.h
    /usr/local/include/php/main/streams/php_stream_filter_api.h
    /usr/local/include/php/main/streams/php_stream_glob_wrapper.h
    /usr/local/include/php/main/streams/php_stream_mmap.h
    /usr/local/include/php/main/streams/php_stream_plain_wrapper.h
    /usr/local/include/php/main/streams/php_stream_transport.h
    /usr/local/include/php/main/streams/php_stream_userspace.h
    /usr/local/include/php/main/streams/php_streams_int.h
    /usr/local/include/php/sapi/cli/cli.h
    /usr/local/include/php/sapi/embed/php_embed.h
    /usr/local/lib/libphp7.so
    /usr/local/lib/php/build/Makefile.global
    /usr/local/lib/php/build/ax_check_compile_flag.m4
    /usr/local/lib/php/build/ax_gcc_func_attribute.m4
    /usr/local/lib/php/build/config.guess
    /usr/local/lib/php/build/config.sub
    /usr/local/lib/php/build/libtool.m4
    /usr/local/lib/php/build/ltmain.sh
    /usr/local/lib/php/build/php.m4
    /usr/local/lib/php/build/php_cxx_compile_stdcxx.m4
    /usr/local/lib/php/build/phpize.m4
    /usr/local/lib/php/build/pkg.m4
    /usr/local/lib/php/build/run-tests.php
    /usr/local/lib/php/build/shtool
    /usr/local/man/man1/php-cgi.1.gz
    /usr/local/man/man1/php-config.1.gz
    /usr/local/man/man1/php.1.gz
    /usr/local/man/man1/phpdbg.1.gz
    /usr/local/man/man1/phpize.1.gz
    /usr/local/man/man8/php-fpm.8.gz
    /usr/local/sbin/php-fpm
    /usr/local/share/licenses/php74-7.4.0/LICENSE
    /usr/local/share/licenses/php74-7.4.0/PHP301
    /usr/local/share/licenses/php74-7.4.0/catalog.mk
    /usr/local/share/php/fpm/status.html
 
Last edited by a moderator:
Update: enabled the following apache 2.4 modules in httpd.conf
Code:
mod_expires.so
mod_vhost_alias.so
mod_rewrite.so
mod_actions.so
Restarted. Still white screen with zero errors.
 
Last edited by a moderator:
Do you have the display_errors, display_startup_errors etc. turned on in your php.ini file? The quick and easy way is to save your default php.ini file and then copy the /usr/local/etc/php.ini-development over to php.ini. Then you should get error messages on your white screen.
 
Do you have the display_errors, display_startup_errors etc. turned on in your php.ini file? The quick and easy way is to save your default php.ini file and then copy the /usr/local/etc/php.ini-development over to php.ini. Then you should get error messages on your white screen.
Thank you very much Datapanic; I will try that!
 
Do you have the display_errors, display_startup_errors etc. turned on in your php.ini file? The quick and easy way is to save your default php.ini file and then copy the /usr/local/etc/php.ini-development over to php.ini. Then you should get error messages on your white screen.
I just enabled all of the error reporting and it still shows white screen with zero errors and a 304 not modified. However, upon the first time executing the info.php; i received a 200 OK. This is very strange.
 
I updated /usr/local/etc/apache24/httpd.conf to enable only the bare minimum modules as follows: (per article here)
Code:
LoadModule authn_core_module libexec/apache24/mod_authn_core.so
LoadModule authz_core_module libexec/apache24/mod_authz_core.so
LoadModule log_config_module libexec/apache24/mod_log_config.so
LoadModule expires_module libexec/apache24/mod_expires.so
LoadModule headers_module libexec/apache24/mod_headers.so
LoadModule version_module libexec/apache24/mod_version.so
LoadModule unixd_module libexec/apache24/mod_unixd.so
LoadModule vhost_alias_module libexec/apache24/mod_vhost_alias.so
LoadModule dir_module libexec/apache24/mod_dir.so
LoadModule rewrite_module libexec/apache24/mod_rewrite.so
LoadModule mime_module  libexec/apache24/mod_mime.so
LoadModule actions_module libexec/apache24/mod_actions.so
LoadModule alias_module libexec/apache24/mod_alias.so
LoadModule authz_host_module libexec/apache24/mod_authz_host.so
LoadModule access_compat_module libexec/apache24/mod_access_compat.so
LoadModule proxy_module libexec/apache24/mod_proxy.so
LoadModule proxy_fcgi_module libexec/apache24/mod_proxy_fcgi.so
Still same problem: no errors and 304 not modified.
 
Last edited by a moderator:
Just to be sure: does your server display correctly a simple html page?
Have you tried to clear the cache of your browser?

Can you check if your browser sends If-Modified-Since header?
 
Just to be sure: does your server display correctly a simple html page?
Have you tried to clear the cache of your browser?

Can you check if your browser sends If-Modified-Since header?
Emrion, Merry Christmas and thank you for your response.

Yes it does display a simple html page correctly with "It Works!"

I have tried to use multiple computers even.

http://sharpenyoursword.org/

When I do a control + F5 or initial page load; I receive a 200 OK. Then after the first load, it changes to a 304.
 
Can you share your php-fpm.conf config file with the pool definitions in it, and the parts of the httpd.conf that sets up the setHandler to the php-fpm proxy that relates to it and any relevant includes files. It might not be configured correctly but we won't be able to help with that without knowing the details.
 
Can you share your php-fpm.conf config file with the pool definitions in it, and the parts of the httpd.conf that sets up the setHandler to the php-fpm proxy that relates to it and any relevant includes files. It might not be configured correctly but we won't be able to help with that without knowing the details.
anlashok,

Thank you and Merry Christmas!

php-fpm.conf pool definition:

Code:
;;;;;;;;;;;;;;;;;;;;
; Pool Definitions ;
;;;;;;;;;;;;;;;;;;;;

; Multiple pools of child processes may be started with different listening
; ports and different management options.  The name of the pool will be
; used in logs and stats. There is no limitation on the number of pools which
; FPM can handle. Your system will tell you anyway :)

; Include one or more files. If glob(3) exists, it is used to include a bunch of
; files from a glob(3) pattern. This directive can be used everywhere in the
; file.
; Relative path can also be used. They will be prefixed by:
;  - the global prefix if it's been set (-p argument)
;  - /usr/local otherwise
include=/usr/local/etc/php-fpm.d/*.conf

Within the /etc/php-fpm.d/ directory there are two configuration files:

www.conf and www.conf.default ; It appears as if the 127.0.0.1:9000 is set correctly to the php-fpm.conf; however there are lots of different options.

Apache 2.4.41 httpd.conf SetHandler:

Code:
### PHP 7.4.0 SetHandler

#<FilesMatch "\.php$">
#    SetHandler application/x-httpd-php
#</FilesMatch>
#<FilesMatch "\.phps$">
#    SetHandler application/x-httpd-php-source
#</FilesMatch>


Thank you very much!
 
I was expecting something a bit more like the below. What you show above hasn't, in the bits you've shared, configured anything to listen in the php-fpm and the bit from the Apache config is actually the commented out version used for mod_php module so isn't doing anything either. You do need this commented out if using php-fpm, but you need to add so extra settings for some handlers for that. I used this as reference daemon-notes.com when I worked out what I needed for my own setup a while ago.

You first need to tell Apache what to do when it gets requests for PHP files, eg pass it to the php-fpm proxy. You need something like this to tell Apache to forward requests for PHP files to the proxy. this example is using unix sockets for the proxy connection. This should be inside a <Directory> or <VitrualHost> directive.

In httpd.conf or a vhost configuration, or wherever you have currently configured the php-fpm settings:
Code:
# these are the two modules that are required for it to work, I think you had these already
LoadModule proxy_module libexec/apache24/mod_proxy.so
LoadModule proxy_fcgi_module libexec/apache24/mod_proxy_fcgi.so

  <FilesMatch "\.php$">
    <If "-f %{REQUEST_FILENAME}">
      SetHandler "proxy:unix:/var/run/sharpenyoursword.org-php-fpm.sock|fcgi://localhost/"
    </If>
  </FilesMatch>

And you need some php-fpm configurations to tell it what to do when it gets the request from the server. The domain-specific settings can either go in the main php-fpm.conf config file or in a separate file in the /usr/local/etc/php-fpm.d/ folder, the www.conf file would be ideal.
In php-fpm.conf:
Code:
[global]
; global settings, alter to your requirements
pid = run/php-fpm.pid
error_log = log/php-fpm.log
syslog.facility = daemon
syslog.ident = php-fpm
log_level = notice

emergency_restart_threshold = 2
emergency_restart_interval = 30
process_control_timeout = 60
process.max = 128
daemonize = yes

; host specific settings, again feel free to adjust to your needs
[sharpenyoursword.org]

user = www
group = www
; this next line needs to match the wording of the httpd setHandler above, I chose your stated domain name
listen = /var/run/sharpenyoursword.org-php-fpm.sock
listen.owner = www
listen.group = www
listen.mode = 0660
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
pm.max_requests = 500
request_terminate_timeout = 300
security.limit_extensions = .php

restart both apache and php-fpm after making changes
Code:
service php-fpm restart
service apache24 restart

Hope that helps you crack this
 
I was expecting something a bit more like the below. What you show above hasn't, in the bits you've shared, configured anything to listen in the php-fpm and the bit from the Apache config is actually the commented out version used for mod_php module so isn't doing anything either. You do need this commented out if using php-fpm, but you need to add so extra settings for some handlers for that. I used this as reference daemon-notes.com when I worked out what I needed for my own setup a while ago.

You first need to tell Apache what to do when it gets requests for PHP files, eg pass it to the php-fpm proxy. You need something like this to tell Apache to forward requests for PHP files to the proxy. this example is using unix sockets for the proxy connection. This should be inside a <Directory> or <VitrualHost> directive.

In httpd.conf or a vhost configuration, or wherever you have currently configured the php-fpm settings:
Code:
# these are the two modules that are required for it to work, I think you had these already
LoadModule proxy_module libexec/apache24/mod_proxy.so
LoadModule proxy_fcgi_module libexec/apache24/mod_proxy_fcgi.so

  <FilesMatch "\.php$">
    <If "-f %{REQUEST_FILENAME}">
      SetHandler "proxy:unix:/var/run/sharpenyoursword.org-php-fpm.sock|fcgi://localhost/"
    </If>
  </FilesMatch>

And you need some php-fpm configurations to tell it what to do when it gets the request from the server. The domain-specific settings can either go in the main php-fpm.conf config file or in a separate file in the /usr/local/etc/php-fpm.d/ folder, the www.conf file would be ideal.
In php-fpm.conf:
Code:
[global]
; global settings, alter to your requirements
pid = run/php-fpm.pid
error_log = log/php-fpm.log
syslog.facility = daemon
syslog.ident = php-fpm
log_level = notice

emergency_restart_threshold = 2
emergency_restart_interval = 30
process_control_timeout = 60
process.max = 128
daemonize = yes

; host specific settings, again feel free to adjust to your needs
[sharpenyoursword.org]

user = www
group = www
; this next line needs to match the wording of the httpd setHandler above, I chose your stated domain name
listen = /var/run/sharpenyoursword.org-php-fpm.sock
listen.owner = www
listen.group = www
listen.mode = 0660
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
pm.max_requests = 500
request_terminate_timeout = 300
security.limit_extensions = .php

restart both apache and php-fpm after making changes
Code:
service php-fpm restart
service apache24 restart

Hope that helps you crack this
anlashok,

You made my Christmas! Thank you so very much! The two changes to each file and a restart pulled through. I went with the unix socket template as you provided and your thorough commented explanation helped tremendously.

God bless you very much!

Best Regards,

Brandon!
 
I was expecting something a bit more like the below. What you show above hasn't, in the bits you've shared, configured anything to listen in the php-fpm and the bit from the Apache config is actually the commented out version used for mod_php module so isn't doing anything either. You do need this commented out if using php-fpm, but you need to add so extra settings for some handlers for that. I used this as reference daemon-notes.com when I worked out what I needed for my own setup a while ago.

You first need to tell Apache what to do when it gets requests for PHP files, eg pass it to the php-fpm proxy. You need something like this to tell Apache to forward requests for PHP files to the proxy. this example is using unix sockets for the proxy connection. This should be inside a <Directory> or <VitrualHost> directive.

In httpd.conf or a vhost configuration, or wherever you have currently configured the php-fpm settings:
Code:
# these are the two modules that are required for it to work, I think you had these already
LoadModule proxy_module libexec/apache24/mod_proxy.so
LoadModule proxy_fcgi_module libexec/apache24/mod_proxy_fcgi.so

  <FilesMatch "\.php$">
    <If "-f %{REQUEST_FILENAME}">
      SetHandler "proxy:unix:/var/run/sharpenyoursword.org-php-fpm.sock|fcgi://localhost/"
    </If>
  </FilesMatch>

And you need some php-fpm configurations to tell it what to do when it gets the request from the server. The domain-specific settings can either go in the main php-fpm.conf config file or in a separate file in the /usr/local/etc/php-fpm.d/ folder, the www.conf file would be ideal.
In php-fpm.conf:
Code:
[global]
; global settings, alter to your requirements
pid = run/php-fpm.pid
error_log = log/php-fpm.log
syslog.facility = daemon
syslog.ident = php-fpm
log_level = notice

emergency_restart_threshold = 2
emergency_restart_interval = 30
process_control_timeout = 60
process.max = 128
daemonize = yes

; host specific settings, again feel free to adjust to your needs
[sharpenyoursword.org]

user = www
group = www
; this next line needs to match the wording of the httpd setHandler above, I chose your stated domain name
listen = /var/run/sharpenyoursword.org-php-fpm.sock
listen.owner = www
listen.group = www
listen.mode = 0660
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
pm.max_requests = 500
request_terminate_timeout = 300
security.limit_extensions = .php

restart both apache and php-fpm after making changes
Code:
service php-fpm restart
service apache24 restart

Hope that helps you crack this
Thank you Anlashok! After upgrading to 13.1, and now that php74 has an expiration date, things got messy on my server when compiling the php80, php80-extensions, and in particular, mod_php80 was unrecognizable by Apache. This was extremely unusual, as I've always installed via ports with few problems. This solved everything, just like it did for StreetDancer. Thanks again!!!
Eric
 
Back
Top