-
Notifications
You must be signed in to change notification settings - Fork 376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add default setup for PHP #73
Comments
I have a very simple setup on my fork, works like a charm since my install 3 days ago: https://github.com/florentdestremau/omakub/blob/master/install/php.sh I'm a Symfony developper so I don't have a good idea of where Laravel might need some tweaks, and it includes extensions that are specific for my project (and some choices such as db drivers). It also includes the Symfony console so that's framework-specific too. |
For Laravel, one of the easiest way to setup a complete dev environment is to use Sail which packages all the docker dependencies for each project. Otherwise, LEMP stack is still one of the most used stack. |
I think the philosophy here is to be as straightforward as possible, rather than relying on Docker. PHP runs perfectly fine with the apt packages and it's the default installation any newcomer would expect / be able to debug on their own |
DDEV is, without question, the tool for this (and many other) job It is written in Go and is docker-based, supports like 20 CMSs, different languages (php, js, python - I see no reason why it couldn't also support ruby), does SSL, allows sharing via public domain, works across OSs, has strong corporate backing but also a non-profit foundation, etc... For PHP, in particular, it allows you to seamlessly toggle debugging and profiling tools like xdebug, xhprof, etc... Easy to add different databases, search engines, etc... I only discovered it last week, but I cannot speak highly enough of it. It's painful to think of the amount of hassle it could have saved me over the years |
PHP installed via APT should be enough for execution of some random scripts when you need an PHP interpreter. But for actual projects, having a complete dedicated environment is a must. DDEV is the de-facto standard for this. You install it once globally and then use it to create an environment for each project you're working on. I've been using it for a few projects (php7.4, 8.2 and 8.3), it's great. You can customize it with custom scripts and Dockerfiles. Another great environment I used a lot (~4 years) is https://github.com/markshust/docker-magento - this one is specific to Magento 2 though and is a better choice for it than DDEV. |
This installs the current PHP and Composer:
But if you need an other PHP version or multiple versions I guess DDEV is better, but I never used it. Maybe PHP should be in the optional folder? |
DDEV might be overkill, especially for projects that are not supported - I have always defaulted to using this PPA https://launchpad.net/~ondrej/+archive/ubuntu/php on Ubuntu installs to get the latest version of PHP. Since Ruby and Go are installed on the system with mise, might make sense to also install PHP on the system? |
DDEV works for any php project with its default |
Good point @nickchomey, I still think its overkill for installing PHP on the system |
I think it's worth considering using Valet instead of Sail. Or at least give both options. I started out with Sail myself but after a while I find Valet and Herd to be better for local development for Laravel. |
IMO, the best way to get PHP is via Additionally, the fork of Laravel Valet for Linux exists, but it would probably be overkill because it installs Nginx and DnsMasq. |
Maybe we start simple. ondrej + composer. Which extensions should be included? |
I agree, PR #87 is installing that. |
I added very basic ones with the 3 main db drivers. Doesn't hurt to put too much extensions but I guess it could scare some people away ? We're back to the debat on having all defaults vs "bundles" of dev environments. IMO I would keep the minimal, most projects have their own README::Install anyways, and most frameworks for beginners have their own self check as well. |
Omakub should be for developers from a large number of communities, and it should work out of the box for them. What's needed for an out-of-the-box experience for PHP, say, someone developing Laravel?
The text was updated successfully, but these errors were encountered: