Serving laravel in xampp pretty urls doesn't seem to display the page

474 views Asked by At

I used xampp for 2 years and discovered laragon and then liked it but after using it for quite some time I had an issue with it because it says Cannot connect to mysql issue, and found some article that might solve the issue

https://forum.laragon.org/topic/490/could-not-connect-to-mysql-10061/2

and i loved the idea of it serving laravel in an easier way wherein you don't have to type php artisan serve any time

but that article above does not helped me, so I reinstalled xampp once again, All i want to do is have that pretty urls that laragon offers,

And then I saw this article :

https://blog.tormix.com/development/xampp-change-localhost-to-custom-domain-name/

But then after doing it when i try to type in the browser the serveralias parameter, it opens the whole directory of the project like a simple php project, how can i make it work ?

1

There are 1 answers

0
Nhi Hong On

There are many reasons MySQL can crash (that why DBA needs to backup and replicate Data). Fortunately, Laragon 3 has "auto create datadir feature":

https://forum.laragon.org/topic/472/laragon-3-0-released-zero-operation-with-postgres-mongodb-node-js-java-python-now-wamp-mean-django-flask-spring-springboot-with-ease

So you can solve your issue easily by:

  1. Rename your old datadir to C:\laragon\data.backup
  2. Start MySQL

If you have backups, just restore them.

Note: This will work with also MongoDB and Postgres.
Laragon is better than XAMPP in many aspects so I hope you can solve your issue to not go back to the old system which may cause you other issues
.