Solved some (config) errors during php installation

apache works, nginx works, but php.info does not load; I followed this guide to install php but beyond that did not configure anything.

php -i|grep mysql
Code:
Configure Command =>  './configure'  '--with-layout=GNU' '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all' '--with-libxml' '--with-password-argon2=/usr/local' '--program-prefix=' '--enable-dtrace' '--enable-embed' '--enable-fpm' '--with-fpm-user=www' '--with-fpm-group=www' '--enable-mysqlnd' '--prefix=/usr/local' '--localstatedir=/var' '--mandir=/usr/local/man' '--infodir=/usr/local/share/info/' '--build=amd64-portbld-freebsd13.0' 'build_alias=amd64-portbld-freebsd13.0' 'PKG_CONFIG=pkgconf' 'CFLAGS=-O2 -pipe -fstack-protector-strong -fno-strict-aliasing ' 'CPP=cpp' 'CXXFLAGS=-O2 -pipe -fstack-protector-strong -fno-strict-aliasing '
Additional .ini files parsed => /usr/local/etc/php/ext-20-mysqli.ini
mysqli
Client API library version => mysqlnd 7.4.30
mysqli.allow_local_infile => Off => Off
mysqli.allow_persistent => On => On
mysqli.default_host => no value => no value
mysqli.default_port => 3306 => 3306
mysqli.default_pw => no value => no value
mysqli.default_socket => no value => no value
mysqli.default_user => no value => no value
mysqli.max_links => Unlimited => Unlimited
mysqli.max_persistent => Unlimited => Unlimited
mysqli.reconnect => Off => Off
mysqli.rollback_on_cached_plink => Off => Off
mysqlnd
mysqlnd => enabled
Version => mysqlnd 7.4.30
Loaded plugins => mysqlnd,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password
API Extensions => mysqli
PATH => /usr/local/mysql/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/home/myname/bin
$_SERVER['PATH'] => /usr/local/mysql/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/home/myname/bin

php -i output is attached as a file.
 

Attachments

  • phi-i output 3aug2022.pdf
    42.6 KB · Views: 12
Thank you SirDice I had followed these steps, checked again, step 4 and step 5 are done, php.info is not loading. I also applied the solution outlined in this forum question moving the 001 file to modules.d did not help, and these are some of the httpd errors from the log:

Code:
[Fri Jul 22 03:07:18.337235 2022] [mpm_prefork:notice] [pid 98972] AH00169: caught SIGTERM, shutting down
PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli.so' (tried: /usr/local/lib/php/20200930/mysqli.so (Cannot open "/usr/local/lib/php/20200930/mysqli.so"), /usr/local/lib/php/20200930/mysqli.so.so (Cannot open "/usr/local/lib/php/20200930/mysqli.so.so")) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mysqli.so' (tried: /usr/local/lib/php/20200930/mysqli.so (Cannot open "/usr/local/lib/php/20200930/mysqli.so"), /usr/local/lib/php/20200930/mysqli.so.so (Cannot open "/usr/local/lib/php/20200930/mysqli.so.so")) in Unknown on line 0
[Fri Jul 22 03:07:18.450247 2022] [mpm_prefork:notice] [pid 80463] AH00163: Apache/2.4.54 (FreeBSD) PHP/8.0.20 PHP/7.4.30 configured -- resuming normal operations
[Fri Jul 22 03:07:18.450318 2022] [core:notice] [pid 80463] AH00094: Command line: '/usr/local/sbin/httpd -D NOHTTPACCEPT'
 
Looks like you have tried installing two versions of PHP and that’s not going to work:

“Apache/2.4.54 (FreeBSD) PHP/8.0.20 PHP/7.4.30 configured -- resuming normal operations”

Choose a version - 8 has a longer lifespan ahead of it - and remove PHP 7.4.
 
Looks like you have tried installing two versions of PHP and that’s not going to work:

“Apache/2.4.54 (FreeBSD) PHP/8.0.20 PHP/7.4.30 configured -- resuming normal operations”

Choose a version - 8 has a longer lifespan ahead of it - and remove PHP 7.4.

Tried to remove them both, pkg delete php74 worked, but pkg delete php80 shows errors:

$ whereis php80
php80: /usr/ports/lang/php80
$ doas pkg delete php80

No packages matched for pattern 'php80'

Checking integrity... done (0 conflicting)
1 packages requested for removal: 0 locked, 1 missing
$ doas pkg delete php8
No packages matched for pattern 'php8'

Checking integrity... done (0 conflicting)
1 packages requested for removal: 0 locked, 1 missing
$ doas pkg delete php8*

No packages matched for pattern 'php8*'

Checking integrity... done (0 conflicting)
1 packages requested for removal: 0 locked, 1 missing

php.info is the php test page.
 
It's www/mod_php74 and www/mod_php80 you have installed. That isn't going to work. It has to match with the PHP version you're using, you cannot install them both.
Thank you SirDice from the respective port directories I ran make deinstall clean for both versions. Can't find a version in answer to the commands php --version and php-cgi --version nor for php -i will install php80 with mod_php80 etc after a reboot.

Update: After port installing php80, mod_php80 and php80-mysqli I now see php test page at

Thank you SirDice and richardtoohey2. Marking the thread solved.
 
Top