Solved Problem with PHP modules on PHP8.1

I have been trying to reinstall postfixadmin. I THOUGHT I had solved it here https://forums.freebsd.org/threads/postfixadmin-and-freebsd-13-2.90996/page-2#post-629043. but. ..nope. After a couple of days of efforts the issue continues. The principle problems now is still with trying to setup which I think is showcasing php problems When I run /usr/local/www/postfiixadmn/public/setup.php. I get the infamous Not Found
No error in a the httpd error log but in general message I get a bunch of PHP warnings. as sample of which is
Code:
PHP Warning:  PHP Startup: Unable to load dynamic library 'session.so' (tried: /usr/local/lib/php/20210902/session.so (Cannot open "/usr/local/lib/php/20210902/session.so"), /usr/local/lib/php/20210902/session.so.so (Cannot open "/usr/local/lib/php/20210902/session.so.so")) in Unknown on line 0
the
Code:
(Cannot open "/usr/local/lib/php/20210902/session.so.so"))

would seem to indicate that I made a cut and paste. But I don't know where

session.so does not appear in php.ini.
Code:
php(info).

although from what I have read it is suppose to be installed by default


Thoughts??
 
Take a note of the pkg prime-origins then uninstall all php pkg's and modules perform a pkg cleanup and install again postfixadmin-php81
 
When I run /usr/local/www/postfiixadmn/public/setup.php. I get the infamous not found
There's a typo here? It says postfiixadmn instead of postfixadmin. Did you mistype it here on the forum post or was it exactly what you typed on your system?

although from what I have read it is suppose to be installed by default
Don't assume, check and verify. pkg info php81-session or pkg info -x php81 and pkg install php81-session if it's not there.
 
Take a note of the pkg prime-origins then uninstall all php pkg's and modules perform a pkg cleanup and install again postfixadmin-php81

There's a typo here? It says postfiixadmn instead of postfixadmin. Did you mistype it here on the forum post or was it exactly what you typed on your system?


Don't assume, check and verify. pkg info php81-session or pkg info -x php81 and pkg install php81-session if it's not there.
Actually you are right it was a typo. BUT the correct typing gets me this error.

Fatal error: Uncaught Error: Call to undefined function session_cache_limiter() in /usr/local/www/postfixadmin/common.php:23 Stack trace: #0 /usr/local/www/postfixadmin/public/common.php(2): require_once() #1 /usr/local/www/postfixadmin/public/setup.php(3): require_once('/usr/local/www/...') #2 {main} thrown in /usr/local/www/postfixadmin/common.php on line
says that is installed BUT deprecated (yes I am running an old PHP) I Install using ports because I started with ports and was told not to more ports and pkgs. This is one of those times I regret it


Take a note of the pkg prime-origins then uninstall all php pkg's and modules perform a pkg cleanup and install again postfixadmin-php81

So this looks ike the best course of action for my mess once I figure what ports to deinstall
 
says that is installed BUT deprecated
No, that's not what the error message is telling you. It says it can't find a specific function (Call to undefined function session_cache_limiter()). A function that's part of the session module. The session module appears to be missing (as indicated by the other files).

(yes I am running an old PHP)
8.1 isn't old? Or am I misunderstanding? The title of the thread mentioned PHP 8.1.
 
well what I didn’t say was that truth thru verification shows that I am running 8.0.30. Like you said don’t assume. Just have to figure out the ports to reinstall the correct version
 
verification shows that I am running 8.0.30
Ok, now I'm thoroughly confused. There's only been mention of 8.1 here, and in the other thread. Where does this 8.0 version come from?

But I am on a deprecated version of php. version 8.0.30.
Ok, you could have mentioned this sooner.

What does pkg version -vRx php80 output? And what does pkg version -vRx php81 output?
 
php81-extensions and php80-extensions default to installing session but php8? defaults to installing nothing, I believe. Just install the appropriate php8?-extensions package.

(defaults are ctype, dom, filter, iconv, json, opcache, pdo, pdo_sqlite, phar, posix, session, simplexml, sqlite3, tokenizer, xml, xmlreader and xmlwriter.)
 
The php8?-extensions port/package are just a convenient way of installing a bunch of commonly used modules. You don't need it, you can simply install each required module separately.

Things go a little haywire if you still have mod_php80 installed but the upgrade installed lang/php81 and the associated php81 modules. If a pkg-upgrade(8) moved everything from php80 to php81 it's going to leave mod_php80 installed. Simple solution, pkg delete mod_php80, pkg install mod_php81 and restart your webserver.

Code:
20221126:
  AFFECTS: users of lang/php80
  AUTHOR: bofh@FreeBSD.org

  The default version of PHP has been switched from 8.0 to 8.1.

  If you use binary packages you should make a list of php packages
  before running 'pkg upgrade':

  # pkg info \*php80\* > ~/installed-php-ports-list

  After the upgrade, check with such list if all your php extensions
  are still installed, and reinstall them if needed.

  If you use mod_php80 you need to deinstall it and install mod_php81.
Note that last line.
 
What does pkg version -vRx php80 output? And what does pkg version -vRx php81 output?
Tor the first
Code:
All repositories are up to date.
mod_php81-8.1.25                   >   succeeds remote (remote has 8.1.24)
php80-8.0.30                       =   up-to-date with remote
php80-imap-8.0.30                  =   up-to-date with remote
php80-mbstring-8.0.30              =   up-to-date with remote
php80-pdo-8.0.30                   =   up-to-date with remote
php80-pdo_mysql-8.0.30             =   up-to-date with remote
php80-session-8.0.30               =   up-to-date with remote
postfixadmin-php80-3.4.d.20211018  =   up-to-date with remote

the second


Code:
mod_php81-8.1.25                   >   succeeds remote (remote has 8.1.24)


Guess I have some ports to work on
 
Guess I have some ports to work on
pkg install postfixadmin-php81 will probably 'automagically' fix things.

You have mod_php81 installed but your application (postfixadmin) and php modules are still at 8.0. mod_php81 is for PHP 8.1, mod_php80 is for PHP 8.0. That relationship should be fairly obvious.
 
Oh I understand about the relationship and need to uninstall. I am only 1/2 as much of an idiot as I appear. ahh maybe 2/3/. Postfixadmin. is a lot closer. My own fault for letting so many things go EOL.
 
My own fault for letting so many things go EOL.
Update frequently and often. Most of the time it's a bit of a chore, boring. Sometimes you have a small step you have to take. The longer you postpone your updates the more and bigger 'steps' you need to take, the larger the task becomes.
 
words ion wisdom. I will be kept busy for a while s a number of "good" stuff has gone EOL. Still dont have postfixadmin up with several Sessions errors like

Warning: session_cache_limiter(): Session cache limiter cannot be changed when a session is active in /usr/local/www/postfixadmin/common.php on line 23
Warning
: session_name(): Session name cannot be changed when a session is active in /usr/local/www/postfixadmin/common.php on line 24
Notice
: session_start(): Ignoring session_start() because a session is already active in /usr/local/www/postfixadmin/common.php on line 25

but those are obviousily a different issue and I will treat them as such. so close ....
 
Back
Top