You are not logged in.
Hi, I'm having issues using the php 7.4 legacy packages with my server - all of my services rely on this. Have spent a couple sleepless nights, and countless hours searching forums, and so far I've had no luck. I have installed the relevant php7 packages (intl, apache, pgsql), yet don't understand what configuration files I need to edit in order for them to work. I've tried rolling back (no luck), and am once again attempting to make the legacy packages work for my install.
I am running Nextcloud, Wordpress, and Restyaboard - i.e., postgresql and mariabd with Apache2. I've tried editing the httpd.conf file to point to php7, and so far nothing seems to work. Any advice/help would be very much appreciated. Apologies for the sketchy details - I'm at a loss to know where to look.
Thanks
Last edited by curiousmitchell (2021-03-11 05:53:43)
Offline
The latest Nextcloud (21) supports php8. It looks like Wordpress does so, too.
Have you seen the news item? https://archlinux.org/news/php-80-and-p … available/
/usr/bin/php -> /usr/bin/php7
/etc/php -> /etc/php7
/usr/bin/php-fpm -> /usr/bin/php-fpm7
/usr/lib/systemd/system/php-fpm.service -> /usr/lib/systemd/system/php-fpm7.service
/run/php-fpm -> /run/php-fpm7
Especially the /etc/php -> /etc/php7 might be helpful.
I must admit I have thrown the towel and will migrate everything to docker instances soon. Might be worth a look.
Offline
Hi Awebb, thanks for the reply. Yes, have seen that news item, and have been trying to make it work. Any suggestions here? It seems I need to redirect the binaries being called from each application... possibly it would be enough to remap httpd? Have tried editing the httpd.conf file, with no great success so far. Currently my apache2 server is running without apache2 errors, but none of the webapps are actually working.
Thinking seriously about docker, or even Debian hosted on Azure - will still keep using Arch for everything cutting edge, but production servers breaking is problematic. And yes - I know Arch isn't generally intended as a production server for that reason... lessons being learned...
Anyway - I'm pretty sure most of what I use will work with php8, but the issue is I can't easily update them, and migrate the data, without using php7 first, and having working instances of the apps. Thus trying to get it working again. I could mostly blow off Nextcloud, and create a new install - similarly for Wordpress, though there is one site I'd eventually like to migrate over. Main issue is with Restyaboard - I'm using an older version which only seems to work with php7 - my attempts to migrate the data onto another server have yet to bear fruit. As we use Restyaboard for work, I need to somehow get it working again sooner rather than later.
Any other ideas of what I could try to get php7 working again? Thanks in advance for any help you're able to offer.
Offline
I have given up on PHP7 on Arch entirely. It'll phase out of Arch soon: "Note that support for php7 will be limited and likely be dropped in about a year depending on how soon the majority of applications will be compatible with version 8." Ten years ago I would have installed some virtual machine for the legacy stuff, but these days container solutions like docker are mature enough.
Arch in production can work, unless one of the major languages gets an update.
Offline
There have always been AUR packages for the previous versions of php, so it's pretty trivial to get them if you need them...
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
Trivial to get packages, however difficult if you don't actually know how to use them. Would appreciate some more help - I can uninstall php (which currently is php8) and install php7, however as its legacy the binanries and files are in different places. Still haven't cracked it.
Is it a better idea to uninstall everything php related, then reinstall a version from the Arch repository which fits what I'm trying to run? Possible packaging hell, but I'm getting desperate. I would really appreciate some concrete advice in how to work with this situation, that doesn't involve giving up. Any ideas?
Thanks again.
Offline
I never thought this would happen, but I see myself becoming a docker advocat :-D
I wrote this reply in some other thread: https://bbs.archlinux.org/viewtopic.php … 9#p1960869
Offline
@awebb I will definitely look into that, but for now I need to get my current install working. I'm closer - but still not there. Tried downgrading to php7.3 through Arch archives, and couldn't get everything working (turns out there's another dependency no longer in the archives. I've now removed php8 entirely, and installed php7, php7-apache, and php7-intl from the legacy package.
Now one of 2 things happens:
1. When I start the httpd service, it works fine, and nothing loads. No Restyaboard... no Nextcloud, etc.
2. If I uncomment this line: LoadModule intl_module /usr/lib/php7/modules/intl.so
Then I'm told that 'the API structure can't load'. (sigh) I can't throw the towel in, start from scratch, or use docker until I can rescue all my Restyaboard info.
Any other ideas?
Offline
If your problem is "using php 7.4 instead of php 8" then it should NOT be more complex than:
- taking every package for php or php-* and replacing them with "php7" prefixed packages
- fixing /etc/php7/ to have the same config you previously set for /etc/php/
- reconfiguring your web server to run /usr/bin/php7 or load modules named "php7"
Are you directly porting your php config to use the php7 paths?
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
@eschwartz
Thanks for your reply.
Re your response:
- taking every package for php or php-* and replacing them with "php7" prefixed packages
Done that.
- fixing /etc/php7/ to have the same config you previously set for /etc/php/
Possibly may not have done this, or somehow copied over the old file. I've looked at this multiple times, and while I think I have it right, may have missed something. What would you suggest?
- reconfiguring your web server to run /usr/bin/php7 or load modules named "php7"
Again, thought I've done this in httpd.conf - seemed to be an initial issue in where the php7 modules were located, then issues with the API not matching up. Do you have any suggestions here?
Are you directly porting your php config to use the php7 paths?
Not sure what you mean here, so probably not.
Below are some logs, from trying to access Restyaboard, one of the main applications i use that's effected. I've replaced the ip address with ipaddress - sure you get the idea:
/var/log/httpd/access_logs
ipaddress - - [11/Mar/2021:11:22:34 +1100] "GET /restyaboard/api/v1/oauth.json?_=1615422154355 HTTP/1.1" 500 -
/var/log/httpd/error_log
[Thu Mar 11 11:23:51.704091 2021] [php7:error] [pid 9624] [client ipaddress:19769] PHP Fatal error: Uncaught Error: Call to undefined function pg_connect() in /srv/http/restyaboard/server/php/config.inc.php:71\nStack trace:\n#0 /srv/http/restyaboard/server/php/R/r.php(26): require_once()\n#1 {main}\n thrown in /srv/http/restyaboard/server/php/config.inc.php on line 71, referer: https://apps.curiouslegends.com.au/restyaboard/
Thanks again, I really appreciate your help.
Offline
Aha, a concrete error message!
/var/log/httpd/error_log
[Thu Mar 11 11:23:51.704091 2021] [php7:error] [pid 9624] [client ipaddress:19769] PHP Fatal error: Uncaught Error: Call to undefined function pg_connect() in /srv/http/restyaboard/server/php/config.inc.php:71\nStack trace:\n#0 /srv/http/restyaboard/server/php/R/r.php(26): require_once()\n#1 {main}\n thrown in /srv/http/restyaboard/server/php/config.inc.php on line 71, referer: https://apps.curiouslegends.com.au/restyaboard/
Call to undefined function pg_connect()
pg_connect is part of the pgsql extension, so... did you install php7-pgsql and enable (uncomment) the pgsql line from /etc/php7/php.ini ?
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
@eschwartz Thank you thank you thank you thank you thank you!!!!!!!!!!!! OMFG... you have literally saved me hours upon hours of work. Really appreciate it.
It's working again. Issue seems to be that I hadn't uncommented the appropriate lines in the /etc/php7/php.ini file. Everything is working now. Thanks again, will mark this thread solved.
Offline
Great, happy to help.
So, this is the case of:
- fixing /etc/php7/ to have the same config you previously set for /etc/php/
Possibly may not have done this, or somehow copied over the old file. I've looked at this multiple times, and while I think I have it right, may have missed something. What would you suggest?
Which indeed you missed something in it.
Last edited by eschwartz (2021-03-11 07:02:00)
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline