I fooled around for hours, and suddenly it's working, and I'm not sure what this I did that fixed it. Man that pisses me off...
Bottom line is that mod_php83
is fucked. I had to remove
it, and build/install mod_php82
from the port, using
the gcc
compiler. Instructions here:
apache24
with mod_php82 won't start up. Scroll down about halfway.
With this fix, apache will now start up with the LoadModule
php_module
statement, but it's still not parsing/executing
php code -- sigh.
date.timezone = America/Los_Angeles
cat /var/db/zoneinfo
; FYI: your 3 letter abbrev can be shown by tail -n1 /etc/timezone
cacert.pem
" (probably
haxx.se). I've put this into the directory with my other
certificates just for ease of locating. Then create symbolic link
to it where php can find it. This fixes curl_init error when
trying to do https connections.cd /usr/local/etc
ln -s
[your certs dir / haxx file name] php-cacert.pem
cd /usr/local/etc
. Check for
existing php.ini
- if not present, copy from one of the
samples. Now edit this file:max_input_vars = 4000
memory_limit = 1024M
session.auto_start = 1
; I think this was needed to make a cmdline execution worksession.save_path = /tmp/php_sess
; be sure to manually create this dir, chmod 700
, chown www
mysqli.default_socket = /var/db/mysql/mysql.sock
;
be sure to manually create this dir; note that this will give a
"file not found" on the first php mysqli call.
pkg install php73
pkg install php73-session
pkg install php73-mysqli
One of my customers uses WordPress and Akeeba backup. You'll need these additional packages:
pkg install php73-zlib
pkg install php73-filter
pkg install php73-simplexml
pkg install php73-mbstring
pkg install php73-hash
One of my packages uses curl with json to communicate outbound:
pkg install php73-json
pkg install php73-curl
Apache interface:
pkg install mod_php73
Edit /usr/local/etc/php.ini
track_errors = 'off'
; before this my php webpages
would get an error about "track_errors has been depracated"./usr/local/etc/apache/http.conf
LoadModule php5_module libexec/apache24/libphp5.so
In my php code:
change:
mysql_connect() to mysqli_connect().
remove mysql_select_db() - it's parm is now the 4th parm to mysqli_connect().
The return from _connect() is now used by the mysqli_ functions,
thus must now be declared as a global in every single fucking
routine that uses it. I HATE PHP - PHP is shit. Ok, it's better
than VBScript, but that's not saying much.
Every mysqli_query() gets a new first parm that is the connect result.
mysql_fetch_object() becomes mysqli_fetch_object(), no parms changes, yay!
mysql_real_escape_string() becomes mysqli_real_escape_string() and
gets the _connect return. Why the fuck a string sanitizer needs the
db connection I cannot imagine - at best, this scares me.
mysql_error() becomes mysqli_error(), needs new connect parm "link".
mysql_data_seek() becomes mysqli_data_seek(), no parms changes.