LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-11-2020, 04:40 PM   #1
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 167

Rep: Reputation: Disabled
Question Building PHP-7.3 and PHP-7.4 on Slackware-14.2


Can anyone please help me with build instructions / scripts to build PHP-7.3.x and PHP-7.4.x respectively on Slackware-14.2 ?

Thank you.
 
Old 03-11-2020, 05:10 PM   #2
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by andrixnet View Post
Can anyone please help me with build instructions / scripts to build PHP-7.3.x and PHP-7.4.x respectively on Slackware-14.2 ?
As far as I know (but someone will correct me when I'm wrong, I'm sure <grin>) you cannot, the support libraries PHP-7 needs just aren't there for 14.2, it is too old for that.
So you will have to update to -current for PHP 7, it has 7.4.3 already built.
 
1 members found this post helpful.
Old 03-11-2020, 05:31 PM   #3
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,258
Blog Entries: 24

Rep: Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193Reputation: 4193
I have built and deployed PHP-7.x beginning from PHP-7.1 through PHP-7.4.2, including some 7.3 updates, on Slackware 14.2 (both 32 and 64 bit), although I have not kept separate build notes for 7.3.x and 7.4.x.

I began with the Slackbuild Patrick posted to your previous thread, modified options to suit my uses, installed a few required packages as needed to resolve build errors, and have had no problems.

In upgrading since the 7.1 build I have had to build and install the following, but not sure which was for a specific PHP version:

alpine (Not sure where I got Slackbuild, try -current)
libsodium (get it from SBo)
oniguruma (SBo)
pcre2 (Built using Slackbuild from -current)
libedit (From -current)

So, to summarize:

1. Get Slackbuild from the link provided by Patrick included above
2. Install above dependencies, possibly others, as indicated by build errors and READMEs

Hope this is enough to get you started, ask here if you encounter anything you cannot resolve!

And perhaps others with more specific knowledge of the requirements will chime in here too.

Good luck!

(Updated to correct original Slackbuild source)
ADDITIONAL COMMENTS: Sorry for posting this piecemeal, that kind of day...

I got around to my build system and looked into how I have actually been doing this instead of reliance on snapshots from memory...

At 7.2.11 I did indeed switch to using the Slackbuild from -current with the following important change (also PHP >7.2 requires libsodium):

Code:
--with-readline
# --without-readline
# --with-libedit
At 7.3 I tested building with libedit and made the switch by building and installing libedit using the Slackbuild from -current. But I continue to build with earlier Alpine and make this change:

Code:
#ALPINE=2.21
ALPINE=2.20
It appears I added pcre2 at 7.4 and removed a few compile options such as --with-gd, --enable-wddx --enable-zip. Run .configure and check the resulting config.log. I also added oniguruma from SBo at 7.4.

I have made a few other changes to the build options in the Slackbuild, but nothing noteworthy that I am aware of. The main point I would make is that PHP up to 7.4.2 builds and works easily on Slackware 14.2 with only a few added dependencies and simple tweaking of the Slackbuild from -current. Just look at the config.log and build errors to sort out the necessary additions and changes - no secret sauce to add that I have encountered!

Last edited by astrogeek; 03-11-2020 at 08:45 PM.
 
2 members found this post helpful.
Old 03-12-2020, 06:38 PM   #4
ljb643
Member
 
Registered: Nov 2003
Posts: 526

Rep: Reputation: Disabled
I built php-7.3.14 and 7.4.2 on Slackware-14.2 with no extra libraries needed. (Going to upgrade to 7.3.15 and 7.4.3 soon.)

It all depends on what PHP extensions you need. If you are packaging PHP for other people to use, like Slackware and Slackbuilds does, you probably want as many extensions as possible, to give end users a wide range. That's going to be hard, and you will need extra libraries and dependencies. But if you are building it for yourself, for your own server, you should have a good idea of what extensions you need. Building PHP with only the extensions you need cuts way down on the dependencies. And remember, it is possible to build and add extensions later without recompiling all of PHP.

The only change I had to make to build php-7.3 and php-7.4 versus older versions was to add --with-pic to the configure command. Otherwise, the final link fails with "read-only segment has dynamic IFUNC relocations; recompile with -fPIC". Don't know what that really means, but the fix worked.
 
2 members found this post helpful.
Old 03-14-2020, 02:55 AM   #5
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 167

Original Poster
Rep: Reputation: Disabled
Thank you very much.
I will try to document my progress (in the hope it will also help others).
 
Old 05-03-2020, 03:37 AM   #6
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 167

Original Poster
Rep: Reputation: Disabled
Cool

Trying to build php-7.3.17 using the php-7.4 build script from -current:
  • pcre2 is a requried dependency (installed via SBo)
  • libedit is a required dependency (installed via SBo)
  • libsodium is a required dependency (installed via SBo)
  • argon2 is a required dependency (installed via SBo)

I preferred to install dependencies rather then configure them out.

It builds without oniguruma as a requirement, one may add it from SBo at your desire.

@astrogeek: thank you very much for your recommendations.
 
1 members found this post helpful.
Old 05-05-2020, 07:45 PM   #7
PROBLEMCHYLD
Senior Member
 
Registered: Apr 2015
Posts: 1,201

Rep: Reputation: Disabled
I use this method and everything is working well

https://www.linuxquestions.org/quest...6/#post6080766
Attached Thumbnails
Click image for larger version

Name:	Screenshot_2020-05-05_19-43-14.png
Views:	143
Size:	194.7 KB
ID:	33168  
 
Old 04-30-2021, 02:30 AM   #8
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 167

Original Poster
Rep: Reputation: Disabled
Smile

Trying to build PHP-7.4 today on Slackware-14.2 got a lot easier.

Dependencies:
  • pcre2
  • libedit
  • libsodium
  • oniguruma
  • argon2
  • tidy-html5


They can be build using either SBo or build scripts from -current in L section. Install each library.


You will need alpine version 2.24 (also found in -current) in N section, package source only.

You should check /usr/local/lib(64)? for directory named c-client. If present, remove it before building. (not removing it will result in errors if it is from an older alpine)

Build PHP-7.4 using build script from -current.

Stop Apache: /etc/rc.d/rc.httpd stop
Install new PHP package. Overwrite (or merge) /etc/php.ini.new -> /etc/php.ini
Start Apache: /etc/rc.d/rc.httpd start

Check /var/log/httpd/error_log to confirm PHP module load was successful.
 
2 members found this post helpful.
Old 05-03-2021, 07:54 AM   #9
Indus.Lord
LQ Newbie
 
Registered: Oct 2020
Distribution: slackware-14.2
Posts: 5

Rep: Reputation: Disabled
Apline ldap failure during php-7.4 on slackware 14.2

Trying to use nextcloud, hence landed here to upgrade php on 14.2 slack.

Checked/got all dependencies, as mentioned by @andrixnet got alpine 2.4 and php-7.4 from -current.

But both alpine and hence php builds fail due to


Code:
/bin/sh ../libtool  --tag=CC   --mode=link gcc -pthread -O2 -fPIC  -L/usr/lib  -o pico main.o utf8stub.o ../c-client/utf8.o libpico.a osdep/libpicoosd.a ../pith/osdep/libpithosd.a ../pith/charconv/libpithcc.a  -lcrypt -lldap -lssl -lcrypto -ldl  -lncurses -llber
libtool: link: gcc -pthread -O2 -fPIC -o pico main.o utf8stub.o ../c-client/utf8.o  -L/usr/lib libpico.a osdep/libpicoosd.a ../pith/osdep/libpithosd.a ../pith/charconv/libpithcc.a -lcrypt /usr/lib/libldap.so /usr/lib/libsasl2.so -lssl -lcrypto -ldl -lncurses /usr/lib/liblber.so -lresolv -pthread
/usr/lib/libldap.so: error adding symbols: File in wrong format
collect2: error: ld returned 1 exit status
Makefile:526: recipe for target 'pico' failed
make[3]: *** [pico] Error 1
make[3]: Leaving directory '/tmp/alpine-2.24/pico'
Makefile:593: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
 
Old 05-03-2021, 08:37 AM   #10
willysr
Senior Member
 
Registered: Jul 2004
Location: Jogja, Indonesia
Distribution: Slackware-Current
Posts: 4,651

Rep: Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772Reputation: 1772
are you using wrong package for ldap-client?
The error message file in wrong format usually happened when you install a package for different architecture
 
Old 05-03-2021, 08:55 AM   #11
Indus.Lord
LQ Newbie
 
Registered: Oct 2020
Distribution: slackware-14.2
Posts: 5

Rep: Reputation: Disabled
Initially I thought it's because "usr/lib" and "usr/lib64" but doesn't look like it.

Code:
bash-4.3$ cd ../lib64/
bash-4.3$ ll liblda*
-rw-r--r-- 1 root root    877 Oct 23  2015 libldap.la
-rw-r--r-- 1 root root    898 Oct 23  2015 libldap_r.la
-rwxr-xr-x 1 root root 326112 Oct 23  2015 libldap_r-2.4.so.2.10.5
-rwxr-xr-x 1 root root 300704 Oct 23  2015 libldap-2.4.so.2.10.5
lrwxrwxrwx 1 root root     23 Dec  6 12:22 libldap_r.so -> libldap_r-2.4.so.2.10.5
lrwxrwxrwx 1 root root     23 Dec  6 12:22 libldap_r-2.4.so.2 -> libldap_r-2.4.so.2.10.5
lrwxrwxrwx 1 root root     21 Dec  6 12:22 libldap.so -> libldap-2.4.so.2.10.5
lrwxrwxrwx 1 root root     21 Dec  6 12:22 libldap-2.4.so.2 -> libldap-2.4.so.2.10.5
bash-4.3$ pwd
/usr/lib64
bash-4.3$ cd ../lib

bash-4.3$ ll liblda*
-rw-r--r-- 1 root root    871 Oct 26  2015 libldap.la
-rw-r--r-- 1 root root    892 Oct 26  2015 libldap_r.la
-rwxr-xr-x 1 root root 329552 Oct 26  2015 libldap_r-2.4.so.2.10.5
-rwxr-xr-x 1 root root 303728 Oct 26  2015 libldap-2.4.so.2.10.5
lrwxrwxrwx 1 root root     23 Feb 12 09:33 libldap_r.so -> libldap_r-2.4.so.2.10.5
lrwxrwxrwx 1 root root     21 Feb 12 09:33 libldap.so -> libldap-2.4.so.2.10.5
lrwxrwxrwx 1 root root     21 Feb 12 09:33 libldap-2.4.so.2 -> libldap-2.4.so.2.10.5
lrwxrwxrwx 1 root root     23 Feb 12 09:33 libldap_r-2.4.so.2 -> libldap_r-2.4.so.2.10.5
bash-4.3$
Package installed should be openldap-client-2.4.42

Code:
slackpkg search ldap

Looking for ldap in package list. Please wait... DONE

The list below shows all packages with name matching "ldap".

[ installed ] - openldap-client-2.4.42-x86_64-1
 
Old 05-03-2021, 12:46 PM   #12
andrixnet
Member
 
Registered: Oct 2012
Location: Romania
Distribution: Slackware
Posts: 167

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Indus.Lord View Post
Trying to use nextcloud, hence landed here to upgrade php on 14.2 slack.

Checked/got all dependencies, as mentioned by @andrixnet got alpine 2.4 and php-7.4 from -current.

But both alpine and hence php builds fail due to


Code:
/usr/lib/libldap.so: error adding symbols: File in wrong format
Have you checked this: https://www.linuxquestions.org/quest...at-4175439373/ ?

My build experience is on x64 machine, all libraries are in lib64 directories.
lib{$LIBDIRSUFFIX} where $LIBDIRSUFFIX=64 (detected in an if block depending on $ARCH). Do check out your architecture and the results of the tests. Or maybe you have a wrong package installed (built for x86 on a x64 system and only now surfaced? dunno)

Last edited by andrixnet; 05-03-2021 at 12:51 PM.
 
1 members found this post helpful.
Old 05-03-2021, 01:30 PM   #13
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
There is no /usr/lib/ldap* on the 64bit package, so if you have it and that's what the program is trying to use, then it is probably from a compat32 package. In that case, you might need to follow the multilib FAQ entry on SBo to get it to compile (or temporarily remove the compat32 openldap package during compilation).
 
1 members found this post helpful.
Old 05-03-2021, 05:15 PM   #14
Indus.Lord
LQ Newbie
 
Registered: Oct 2020
Distribution: slackware-14.2
Posts: 5

Rep: Reputation: Disabled
Thank you very much both @andrixnet and @bassmadrigal

Not just LDFLAGS I had to push in additional configure flags to get alpine slackbuild to successfully complete

Code:
-- I edited alpine.Slackbuild and pushed in

  --with-ldap-lib-dir=/usr/lib64 \
  --with-ssl-lib-dir=/usr/lib64 \
That way I was able to get over the 32 bit lib being used

Now that alpine is done, on to PHP :-)
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Any advice on building and running xrdp and xorgxrdp on Slackware? allend Slackware 33 01-23-2018 07:24 AM
Building an out-of-tree module without building the kernel source lijodevasia Linux - General 2 08-01-2013 12:45 AM
website building software and php download using terminal (ubuntu) jessica_lilly Linux - Software 1 11-11-2007 11:41 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration