r/PHPhelp • u/Brave_Flamingo_ • Dec 12 '22
Starting with PHP
I want to start learning php but the tutorial I was referring to uses XAMPP and I already have MySQL workbench installed on my pc and they both keep clashing together. Is there a better way of running php ?
7
u/itemluminouswadison Dec 12 '22
Id use docker if you can
Otherwise install php locally and start a server with 'php -S localhost:80' then visit localhost in your browser
4
u/steven447 Dec 12 '22
Yeah using XAMP or something similar is a very outdated way of locally developing PHP software.By learning Docker learn a lot of other useful skills and it is way easier to setup and use than XAMP if you are used to it.
1
2
u/MateusAzevedo Dec 12 '22
XAMPP is just a bundler that install a webserver (Apache), Database (MySQL) and PHP, which is the minimum needed to run PHP projects.
You can simply install everything yourself, or uninstall MySQL (what you called MySQL workbench) and use XAMPP.
2
u/dabenu Dec 13 '22
I think nowadays it's more common to just install PHP (and MySQL if needed) and use the PHP webserver for local development.
2
u/kAlvaro Dec 13 '22
What do you mean when you say that XAMPP and MySQL Workbench clash together? They shouldn't. Is it possible that you didn't install MySQL Workbench but MySQL Server? XAMPP already contains the latter, so obviously you can't have both running on the same port.
1
u/32gbsd Dec 12 '22
You need a webserver or maybe you dont? google "installing php without a web server"
1
Dec 13 '22
If your goal is to learn php using an obsolete environment that pro developers don't use, then by all means continue with xamp. For php workstation installs it's not used by any pro developers I know, as others have emerged, but quite frankly pros are generally using Docker based environments for many reasons I won't go into. If you need a help up I'd suggest using Laradock, which is well supported and used by lots of Laravel developers. Despite the name it will provide you what you need without installs of all the components running as services on your workstation. The documentation should get you up and running with a few small edits of a .env file you keep in your project directory. That a tutorial leads you down the xamp path, certainly does not inspire confidence in the quality of the tutorial.
1
u/lucasjose501 Dec 13 '22
Assuming you are using windows, for starting I recommend Laragon. It has everything, php, database, terminal, log viewer, host management, git, composer, basically everything for local development. And you just need to run it and done because everything is already configured. Easy to configure and have some great tutorials too.
Docker is good too, but if you are new I recommend Laragon to avoid confusion and focus learning php.
1
u/[deleted] Dec 12 '22
Just don't use the XAMPP one. Don't try to use them both. As long as your software is running a server locally you'll be able to connect to it providing the port is open