Sometimes, especially when you're at the beginning of your career, it can seem that you're following the instructions and getting nowhere - while e...
For further actions, you may consider blocking this person and/or reporting abuse
I love Laravel, but in their endless quest to make things "simpler" I feel they ended up making things way more complicated and confusing ...
Apart from "the Laravel installer" we have Valet, we have Herd, we have Sail, and I probably forgot a couple of others ...
When you want to add signup/login/authentication to your app, you're faced with literally half a dozen alternatives - there's Breeze, there's JetStream, there's Fortify, there's Sanctum, there's Passport, there's Socialite, and I probably forgot half a dozen other options - I found it a nightmare to make a choice.
Most funny thing IMO is that with Laravel 11 they tried to "simplify" even more by sweeping a lot of options which there out in the open in previous versions under the rug, hiding them behind a simplistic interface - nice for noobs, not so nice for people who already know Laravel and are now wondering "where did all my settings go ... ?"
But, I love Laravel, I really do - it's elegant and powerful - but it does NOT promote the principle "there's one and only one way to do something" - with Laravel there are always more ways to achieve something, and it can be pretty confusing at times ...
As someone whoβs been through similar struggles with setting up Laravel, this post hits home. The detailed recount of troubleshooting is so relatable. Honestly, after experiences like these, moving to a platform like Cloudways was a game-changer for me. Their managed hosting takes care of PHP extensions, Composer, and database setups out of the box. I was able to spin up Laravel apps in minutes without these headaches. Definitely worth considering for anyone tired of the manual setup grind!
nice π
Another way of preparing your pc is to use Laravel specific solutions like herd or sail or docker wrappers like ddev or lando.
I use a docker solution, or just plain docker, because that will match the closest with the server. And you can save the config in the codebase, so other people can use the same setup.
From the documentation,
So that doesn't help if you can't get Laravel running, right?
And Herd appears to be Windows and Mac only, which isn't much use.
I have also run Laravel in docker but the point of this post was to show how things aren't straightforward if you just try to follow the instructions as they're given.
If there are no errors with the artisan command, you can run
artisan sail:install
.I wasn't aware Herd is not available on linux. I guess not enough developers use a linux only pc.
I understand your point. The problems you encountered are more composer related problems than Laravel related problems. When I look at the composer files of the packages the php dependencies are added. Is it possible you ignored the warnings during the composer installation? And that is why you didn't add the php extensions?
It's been a long time I have set up a machine from scratch. But I think composer gives you a warning.
Ok, to answer these points in order:
artisan
isn't a dependency, isn't mentioned in their installation instructions, and isn't installed along with PHP or composer. It's not installed to the global composer store as part of the laravel installer; it's part of a laravel project itself. The laravel project needs to be successfully installed before you can run it. In my post, the point where artisan is available to run as a command is the end, where I mark my great success.The rationale for Herd not being on Linux (from the official page) is that Linux users are probably capable of doing all this themselves anyway - which is probably fair enough but I'm trying to demonstrate that following instructions isn't as simple as it appears :)
Composer doesn't list any warnings or errors when installing laravel. None on the things I had to install manually are in the composer.json file of the laravel installer or the laravel example project. They're presumably dependencies of dependencies, which don't get resolved until the installer's actually running.
After reading your message I regrouped my thoughts and read the post again. You would have had less problems if you checked the server requirements before you started to install LaraveL.
That is take 2 and 3 of your post
The sections before take 2 are about composer. I think we can agree that is outside the scope of Laravel documentation.
My conclusion from the start was that this post is blaming the wrong one for the problems you experienced. I took a detour by suggesting to use php specific containers. And moved it even further from the solution with my second reply. That is my mistake.
Possibly, possibly, however the info about server requirements is under a section called "deployment" and comes after the documentation about "getting started" and "installation". I'm literally devoting this experience to following the instructions as given.
I agree there should be a link to the requirements before the installation process. You can create a pull request on the documentation repository
Try php.new and the follow laravel.build
PHP.new is nice!
For me it's not "nice" at all - as Ben pointed out, it bypasses your OS's package manager ... also pointed out by Ben - which extensions will it install? Pointed out by me - does it include Xdebug? Which PHP version? What about upgrading your PHP version?
Apart from that, PHP is just one thing I'd want to install - there's Apache or Nginx, there's MySQL or PostgreSQL, and so on ... why would I want "ad hoc" custom scripts to install all that? I just want to use my OS's package manager to properly manage it!
So no, not seeing how an "ad hoc" script from a website somewhere is a good solution at all.
I get your point, and I agree with it. But sometimes it's needed to build something that works great for one use case. And that could be a good inspiration if the value proposition works out.
There are lots of examples out there with a script-like solution to get something working. If there's a need for something, and there's nothing else available built-in, then someone will build it. I see it more like an opportunity, than a thread.
I get what you mean - it's just a tool, use it when it's the right tool for the job!
As others have said for Linux
/bin/bash -c "$(curl -fsSL php.new/install/linux)"
However itβs never a bad thing to highlight how installations are never as simple as first expected and this can sometimes be a barrier to entry for a beginner
I think you're missing the point here - I'm detailing what happens if someone with general knowledge follows the instructions, I'm not looking for a solution.
But to respond to the php.new chat, I don't think that's a great way to install software.
You're installing binaries which possibly shadow ones already on your system, by bypassing your existing package manager. This means it's more manual steps to remove once you discover you need a different version of PHP, say. The code also waves a couple of red flags regarding things like useless use of
touch
, or the way that it downloads the laravel installer instead of using composer to install it, presumably because it doesn't install composer fully.The implication is also that either the php.new version of the PHP binary comes with extras baked in or it's irrelevant to the problems I was finding. The only thing that script can do for me is to put
composer
into myPATH
, in a particularly sledgehammer approach.If I was going to do this myself, I'd probably use Ddev :)
Well, nowadays we have php.new to install all needed packages, it simplifies a lot this process
I just took a look at that. It doesn't solve the problem of global composer binaries not being in the path; it's just a special case for laravel really... and you don't get to choose your version or have any of the control you'd have if you installed through your regular package manager.
Oh, and the script is a great example of how not to use the
touch
command which doesn't fill me with confidence :)Completely agree, 100% an "ad hoc" fix and in no way a complete or well thought-out solution - do use it of you want to paint yourself into a corner ;-)
I've given up on Laravel. Any project that puts together such a disaster of documentation is not worth using and I don't know how anyone does frankly. After trying to get it up and running your page here saved me a lot of F-bombs. But I'm still stuck trying to get the damn thing to DO anything. It terrifies me to load this crap into my delivery pipeline and try to replicate it's functionality in production.
To be fair, I think the Laravel documentation is well above average. It's a tricky thing to keep up-to-date as a developer, because it's so easy to forget that new users don't know the same things you do, so adding abbreviations without explanation, putting things in the wrong order or skipping "obvious" steps happens all over the place in tech docs.
It's why people submitting contributions for documentation is just as valuable as for the codebase itself.
Try Laravel herd follow itβs steps. It was what worked for me.
I was installing this on Linux following the instructions; Herd is for Windows and Mac, so it's not going to help in this case.