Topic: Creating symlink and paths for 8.1.14

Hey Remi,

It's an odd question but I hope you can help. I have the following scenario.

We have a development env which runs on your PHP 8.1.14 with OS - CentOS7 x86_64. Now I'm creating the same environment but on CentOS7(arm/aarch64).
I know you don't support arm/aarch64 for CentOS7 but my inquiry is a little bit different here.

I'm trying to find out if I can reproduce these paths on the PHP I'm compiling for source.

/etc/opt/remi and opt/remi/php81

Currently the compiled PHP from source resides here /etc/php.d/

Would you be so kind to let me know how you've managed to make your path /etc/opt/remi and /opt/remi/php81 or point me to an article/book where I can do a research.
The reason for using the same path is to avoid rewriting several of the app scripts. I you can't point me to a hint/solution my last resort will be to rewrite the scripts.



Thanks!

Re: Creating symlink and paths for 8.1.14

1/ do you really need multiple versions simultaneously?

If no, follow the wizard instruction for "single version" and everything will use /etc

this is really the simplest way

2/ if you need multiple versions you need to build SCL

Documentation: https://www.softwarecollections.org/en/docs/

This is quite a long way, as you have to use a dedicated build root (mock configuration)

- with scl-utils in buildroot, build the "php81" metapackage

=> https://rpms.remirepo.net/SRPMS/php81-8 … mi.src.rpm

- with php81-devel in buildroot, build the "php81-php" main package and needed extensions

=> https://rpms.remirepo.net/SRPMS/php81-p … mi.src.rpm

Notice: default path will be /opt/<vendor>, vendor="remi" for my repository ("rh" by default)

Everything is stored on git, including my mock configuration files

=> https://git.remirepo.net/cgit/tools/mock.git/tree/

but, IMHO, you should really consider 1/ "single version"


P.S. does it really worth the investment for EL-7 which will be EOL in a few months....

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

3 (edited by kdgeorgiev 2023-01-06 08:31:20)

Re: Creating symlink and paths for 8.1.14

Hey Remi,

Thanks for the prompt reply!



1/ do you really need multiple versions simultaneously?

If no, follow the wizard instruction for "single version" and everything will use /etc

this is really the simplest way



Well I don't need to use multiple versions. The app I'm building in few simple sentences explained.

1. Creates a base docker image and install the PHP 8.1.14 with logic to pick AMD architecture or ARM.
We use only single version PHP on AMD and ARM.
2. Creates a core image with all the bundles.
3. Developer start the project.


Thanks a lot! I will go through the links.



P.S - Well I've been fighting with the ARM - CentOS7 for few months now. It's not a decision for me to make. If it was up to me then Rocky Linux 9 would be my ARM choice. Literally there are no packages on CentOS7-ARM and it's not well maintained/supported as the AMD.

Re: Creating symlink and paths for 8.1.14

Notice, there is https://repo.drpixel.fr/enterprise/7/

DrPixel is used to rebuild my packages for aarch64, and provides PHP 8.1
But only as single version
And it rebuild only "some" versions, according to his spare time.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Creating symlink and paths for 8.1.14

Remi wrote:

Notice, there is https://repo.drpixel.fr/enterprise/7/

DrPixel is used to rebuild my packages for aarch64, and provides PHP 8.1
But only as single version
And it rebuild only "some" versions, according to his spare time.


I'm aware of Dr.Pixel. I was able to make the ARM environment work with his 7.4. But unfortunately I have to upgrade it to 8.1.14. His repo has 8.1.9 only and not 8.1.14 and unable to get in touch with him to assist with maintaining the repo.


Oh! I forgot to mention what do you mean by : If no, follow the wizard instruction for "single version" and everything will use /etc ?
Compiling it from source or using another way to make PHP 8.1.14.

Re: Creating symlink and paths for 8.1.14

> Oh! I forgot to mention what do you mean by : If no, follow the wizard instruction for "single version" and everything will use /etc ?

I mean, for installation of the single / default version in /etc
see the wizard installation

Link on all pages of the repo / blog / forum (top right)
=> https://rpms.remirepo.net/wizard/

Which is about installing php-* packages (base) instead of php81-php-* packages (SCL)

Also read the FAQ
=> https://blog.remirepo.net/pages/English-FAQ#scl

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Creating symlink and paths for 8.1.14

Thanks Remi!

I will go through all the url's that you've provided me.

Re: Creating symlink and paths for 8.1.14

Morning Remi,

Quick question. I went through the Software Collection Packaging Guide and Quick Start but where I can take a look at a guide or walkthrough on how to pack a PHP.
It seems I can't grasp where to place the PHP goes so I can package it in a .rpm file with the path directories we've discussed above.

Or if I can see how to pack a single php module such as php81-bcmath and grasp the context I will be able to pack the PHP 8.1.14 and etc.

Apologies to bother you!

P.S. from what I've read in the Software Collection Packaging Guide your mock.git files are looking differently.

Re: Creating symlink and paths for 8.1.14

From your answers:

> Well I don't need to use multiple versions.

So why are you going the SCL way?

For build step, read again https://forum.remirepo.net/viewtopic.ph … 437#p12437

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Creating symlink and paths for 8.1.14

Yes I thought a single version would be the best choice but I was told couple of days ago that I need to make sure PHP 7.4 works for our project. As some developers need more time on PHP 7.4 before migrating their code to 8.1.14.

Once again I've mentioned to you that I'm trying to use Software Collection on an ARM CentOS7. So it means I can use the provided files from you and build the ARM package ?

Re: Creating symlink and paths for 8.1.14

> So it means I can use the provided files from you and build the ARM package ?

You can (as these are the only files I use for my build)

But you have to be expert with packaging and build system, especially as SCL the a very complex task

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Creating symlink and paths for 8.1.14

> 1. Creates a base docker image and install the PHP 8.1.14 with logic to pick AMD architecture or ARM.
> We use only single version PHP on AMD and ARM.

Especially with docker....
You can use one image for 7.4, and another for 8.1
I really don't see any need for SCL.

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Creating symlink and paths for 8.1.14

Remi wrote:

> 1. Creates a base docker image and install the PHP 8.1.14 with logic to pick AMD architecture or ARM.
> We use only single version PHP on AMD and ARM.

Especially with docker....
You can use one image for 7.4, and another for 8.1
I really don't see any need for SCL.

What you're suggesting then just create a regular .rpm PHP 8.1.14 and PHP 7.4 files and give them your directory path /opt/remi and etc.. ?

Yes, I though SCL is very complex. Reading it for the past week some thing doesn't make sense to me yet.

Like I mentioned earlier I need my arm PHP to have /opt/remi/ path so it matches your repo. This will save me time of rewriting the logic of one our scripts. It will allow me to go straight into testing and building the images.

Re: Creating symlink and paths for 8.1.14

> What you're suggesting then just create a regular .rpm PHP 8.1.14 and PHP 7.4 files and give them your directory path /opt/remi and etc.. ?

No using standard prefix: /etc, /usr/bin/, /usr/lib64

> Like I mentioned earlier I need my arm PHP to have /opt/remi/ path so it matches your repo.

For you x86_64 also switch to "single" version, and stop using SCL everywhere

So you will use same standard path for aarch64 and x86_64

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Creating symlink and paths for 8.1.14

Okay!

But using /etc/ /usr/bin /usr/lib64 prefix can be achieved through building the PHP from source. However our ADM environment is using your repo for years and it's automated to a point were we won't revert to using /etc/, /usr/bin and /usr/lib64.

That's why I have to make the ARM environment similar and stick with your prefix. When I rewrite the script logic to pick AMD or ARM but with different prefixes it doesn't like it and start to break the docker image that is build locally.

Re: Creating symlink and paths for 8.1.14

Please read documentation / FAQ / wizard instructions.

My repository provide 2 set of packages

- single version => in default path, /etc, /usr/bin and /usr/lib64.
- multiple versions (aka SCL) => in /opt

> But using /etc/ /usr/bin /usr/lib64 prefix can be achieved through building the PHP from source.

No building from sources uses /usr/local tree.

> it's automated to a point were we won't revert to using /etc/, /usr/bin and /usr/lib64.

So you have to learn to build SCL.

Sorry, but I don't think I can help more
You already have all my files in previous links, and even how to rebuild from proper .src.rpm

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Creating symlink and paths for 8.1.14

Remi wrote:

Please read documentation / FAQ / wizard instructions.

My repository provide 2 set of packages

- single version => in default path, /etc, /usr/bin and /usr/lib64.
- multiple versions (aka SCL) => in /opt

> But using /etc/ /usr/bin /usr/lib64 prefix can be achieved through building the PHP from source.

No building from sources uses /usr/local tree.

> it's automated to a point were we won't revert to using /etc/, /usr/bin and /usr/lib64.

So you have to learn to build SCL.

Sorry, but I don't think I can help more
You already have all my files in previous links, and even how to rebuild from proper .src.rpm


Thank you Remi!
Okay I'm going to go through the Documentation/FAQ/Wizard instructions again.
And I will need to learn SCL or try to make your repo work for arm (CentOS7).

Last but not at least I can rewrite the prefix path with your single version if I can make it work on CentOS7 arm.

Re: Creating symlink and paths for 8.1.14

Hey Remi,

After long long hours of read I've managed to grasp what you've meant! I went through the documentation again.
Okay we would need a single version as you've said from the start. What I need to do now is see how I can bundle your PHP and make it work on CentOS7.
No need for SCL or other fancy tools.

Now let me figure out how to make your PHP 8.1.14 work of EL7/CentOS7.

Re: Creating symlink and paths for 8.1.14

Remi,

I've managed to make great progress by using the instructions that you've provided me.
Can you clarify if I'm in the right direction.

When I change the logic of this to

%global upver          8.1.14
#global rcver          RC1
#global lower          RC1

And add the source to get it from her: Source21: https://www.php.net/distributions/php-% … tar.xz.asc

I will be able to get 8.1.14 as my main version ?

Thank you!

Re: Creating symlink and paths for 8.1.14

> When I change the logic of this to

Change what ? from what ? in which file ?

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Creating symlink and paths for 8.1.14

Well I'm currently making changes in the php81.spec file.

The %global upver variable now stands at: 8.1.9 (for example) and I"m about to change it to 8.1.14

Few lines below the variable I see this:

# See https://secure.php.net/gpg-keys.php
Source20: https://www.php.net/distributions/php-keyring.gpg
Source21: https://www.php.net/distributions/php-% … tar.xz.asc

I assume once the %global upver variable is changed to 8.1.14, source 21: would get the 8.1.14 version.

Re: Creating symlink and paths for 8.1.14

Why do you want to reinvent the wheel ?

> The %global upver variable now stands at: 8.1.9 (for example) and I"m about to change it to 8.1.14

This may work... or NOT...
There may be other changes (patches...)

Why don't you simply use the .src.rpm of the wanted version?

Or the spec file of the wanted version, from git?
using git history if you don't want the latest 8.1.15

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Creating symlink and paths for 8.1.14

My goals is not to make my life harder.
Okay then!
If I use your php-8.1.14_RC1-1.remi.src.rpm and then unpack and pack it on my ARM machine to get an .rpm file for aarch64 would that work ?

Re: Creating symlink and paths for 8.1.14

> If I use your php-8.1.14_RC1-1.remi.src.rpm and then unpack and pack it on my ARM machine to get an .rpm file for aarch64 would that work ?

It should work (if you also have needed dependencies)

Laptop:  Fedora 38 + rpmfusion + remi (SCL only)
x86_64 builder: Fedora 39 + rpmfusion + remi-test
aarch64 builder: RHEL 9 with EPEL
Hosting Server: CentOS 8 Stream with EPEL, rpmfusion, remi

Re: Creating symlink and paths for 8.1.14

Okay!
I do have all the dependencies. Let me try it now.