php / php-src

The PHP Interpreter
https://www.php.net
Other
38.18k stars 7.75k forks source link

Request for PHP Official to Provide Standalone Linux Binary Packages #15916

Open eatmeatball opened 1 month ago

eatmeatball commented 1 month ago

Description

Background

When embarking on the journey of software development, especially for newcomers, setting up a development environment can often be a complex and time-consuming process. Many developers may feel overwhelmed by environment configuration issues, which can hinder their learning experience. To reduce this barrier, several programming languages and frameworks have begun to offer standalone binary packages that are ready to use, rather than just source code.

Binary Packages vs Source Code

For beginners, one of the most significant challenges is figuring out how to build an entire development environment from scratch. In contrast, binary packages provide numerous advantages:

Benefits of a Unified Ecosystem

Providing a consistent binary package also helps to create a more unified ecosystem. Here are several potential benefits:

Conclusion

We hope that the PHP official team will consider releasing a standalone Linux binary package for PHP. This initiative would greatly facilitate the learning and usage of PHP for newcomers, while also enhancing the uniformity and user experience across the PHP ecosystem. By drawing on the successful practices of other programming languages, we believe this change could attract more new users and increase engagement within the PHP community.


e1 node: image

e1 golang image

iluuu1994 commented 1 month ago

There have been some plans to improve installation instructions. /cc @pronskiy @derickr

ooing commented 1 month ago

I think this is really necessary

NattyNarwhal commented 1 month ago

Miss me with the ChatGPT intro, but I think historically why this didn't happen:

(Disclaimer for transparency: I provide a commercially supported PHP distribution for IBM i, and thus have worked on i.e. system integration stuff.)

mouyong commented 1 month ago

When I completed projects using PHP, it was tedious and complicated to deal with the environment independently for each deployment.

In different teams, the environmental dependencies of PHP are also different. When the team first switches to a unified environment, someone needs to complete the containerization process, which is also a complicated matter.

PHP currently cannot have an environment through one installation like nodejs, python, etc. Users are always required to build more additional adaptation environments (such as web servers nginx, apache).

When I want to migrate a PHP project from a monolithic project to a containerized project, the level of tedium is even higher. You need to select the Ubuntu system environment, choose the dependencies to install, and process how web requests are processed by the PHP interpreter. These are disaster-level difficulties for those with less overall experience. Basically, it is more difficult for users with 1 to 3 years of experience to complete it. But compared with python and nodejs, it is indeed very easy. Just need from the official image. Install the project dependencies and run the project to complete. Not PHP.

JaguarJack commented 1 month ago

When I write beginner tutorials, I find it relatively difficult from my personal perspective. I need to explain a lot, such as where to install PHP, where the PHP directory is, and how to configure PHP's environment variables to use the PHP interpreter in the console. Especially on Windows, if I don't use some integrated software, I really don't want to explain it to beginners; it's too troublesome.

In my vision, if the official PHP development team could take some time to make PHP an executable file and integrate the Composer package manager, it would be invaluable for the development of PHP. I see many RFC proposals that do not contribute to the popularization of PHP. What PHP needs is to lower the entry barrier for newcomers. I see other languages evolving, with their usage thresholds getting lower and lower, while PHP remains stagnant. Installing PHP on a new machine has been the same for the past ten years. This can be considered a regression.

Please give this issue the attention it deserves. I truly hope PHP will continue to improve and become more accessible.

weijer commented 1 month ago

This is really necessary 🎉

AuroraYolo commented 1 month ago

good idea

woshijxh commented 1 month ago

good idea

wdwlrz commented 1 month ago

we need it, just for a simple way of install and some simple scenes

KingBes commented 1 month ago

I think either make a PHP compiler

kanyxmo commented 1 month ago

This is really necessary 🎉

iluuu1994 commented 1 month ago

Ok guys, please use the +1 button instead of spamming hundreds of people. :slightly_smiling_face:

tlxf commented 1 month ago

I strongly agree with this proposal, it is really necessary, and I hope PHP officials will consider it.

echoyl commented 1 month ago

+1

jingjingxyk commented 1 month ago

Standalone PHP Binary Packages

https://github.com/swoole/swoole-cli/releases

https://github.com/swoole/build-static-php/releases

usage :

curl -fSL https://github.com/swoole/swoole-cli/blob/build_native_php/setup-php-cli-runtime.sh?raw=true | bash
curl -fSL  https://github.com/swoole/build-static-php/blob/main/setup-php-fpm-runtime.sh?raw=true | bash 

curl -fSL https://github.com/swoole/swoole-cli/blob/main/setup-swoole-cli-runtime.sh?raw=true | bash
cmb69 commented 1 month ago

Especially on Windows, if I don't use some integrated software, I really don't want to explain it to beginners; it's too troublesome.

But exactly for Windows we are shipping binaries. I still do not understand what this feature request is about.

NattyNarwhal commented 1 month ago

I think you have to set up i.e. web servers and databases. Latter is expected with other languages (unless you’re using SQLite), but the former is a bit unusual other than getting a production web server to front for your app server, since your web application in i.e. Node or Python is an app server of its own.

That said, on Windows, XAMPP seems to be really popular for teaching, since it handles the setup of all of a historically popular AMP environment for you. When I was in school, they were using that; I have to imagine it’s popular elsewhere.

iluuu1994 commented 1 month ago

but the former is a bit unusual other than getting a production web server to front for your app server

Well, there's php -S now, which works quite well most of the time.

I still do not understand what this feature request is about.

The description hints at two things:

  1. Providing binaries
  2. Improving installation instructions on the php.net website

While there's no interest for 1. from our side, 2. is already actively being discussed. We already provide binaries for Windows, macOS is covered by Brew, and Linux distros package PHP themselves. So instead, the installation page should give platform/distro specific instructions. We can definitely improve here.

As for building a universal binary that works for everybody: This is hard. People have different requirements. We would most likely need to bundle libraries statically, which means we'll be responsible for providing patches, picking the right versions (some people like stability, some bleeding-edge), etc.

That said, FrankenPHP does pretty much exactly that, in addition to bundling Caddy, a production ready webserver. Note though that it is a relatively new project, and not directly associated with the PHP group.