Laravel 5.2 run in localhost without using php artisan serve - php

Okay, so I created a Laravel 5.2 app (mylaravel). I am currently working in Ubuntu 14.04 with XAMPP for Linux 5.6.15. The app works whenever I run it using php artisan serve (afterwards it works by visiting http://localhost:8000 <-shows my login page). I can login/logout, etc. Without running the artisan serve first, visiting http://localhost/mylaravel will render my login page BUT upon trying to login it says "The localhost page isn’t working" with error code 500. What I'm doing wrong here? Thanks in advanced.

Using your xampp shell and changed to your project directory, try
php -S localhost:8888 -t public
then you should be able to access your project by using localhost:8888 in a browser

First make sure that in your XAMPP manager you have MySQL and Apache both turned on.
Second, make sure that all your databases, tables and so on are in your MySQL XAMPP instance. You can check this by using PHPMyAdmin which comes with your XAMPP install: http://localhost/phpmyadmin
If all is good and you're still getting a 500 error, check your apache logs within your XAMPP instance.

Related

Working Laravel in CPanel but not in localhost without Artisan

I've installed in my remote server, via Softaculous, Laravel 8.
In order to access directly to the APP, just like when running php artisan serve in my local machine, in CPanel i defined the document root to the folder Laravel\public.
Everything works exactly as it should! I type the address (ex: myDomain.com) and the App runs perfectly...
However i don't want to being always typing php artisan serve while developing, so i tried to replicate the cpanel struture in my local machine.
To achive thar, i've created a virtualhost in XAMPP httpd-vhosts.conf pointing to the folder Laravel\public, and created the host file in windows system, like always.
When accessing the location in my local machine the first page renders perfectly, but as soon as i make a request for a new view, by example:
Route::get('/posts', function () {
return view('posts.index');
});
I get a "Not Found The requested URL was not found on this server" error! I'm sure is not a coding error because the same code runs flawlessly in remote server.
Which technique is used by cpanel to allow laravel to work directly from \public folder without necessity to initiate anything and how to replicate that in local development machine?
Well...
After much reading, backs and forwards, i believe this behavior depends on the way Apache its served by XAMPP.
So, the solution i adopted was change my local development tool to LARAGON.
Everything worked just fine with a lot of new features that don´t exist in XAMPP.

Why does Symfony ask a valid token when I start a local server?

I have a symfony 5.1 application under development on my laptop.
This command failed:
symfony console server:start
Your token has been revoked, please login again
Then, the prompt purposes me to login, but I cannot always login, because I'm behind a firewall that rejects external access for some security reasons.
I tried :
to uninstall the local certificate authority,
to launch server without TLS,
to launch server with the command symfony serve -d (I got the same error message)
to launch application with different version of PHP (by using .php-version file)
It's perhaps because I tested a demo symfony cloud which is expired. So, I tried to remove all elements about cloud.
Without success...
As soon as I am offline, the server can be started.
As soon as I'm connected on other network I can login, but I want to launch this local server when I'm on our enterprise network. (And I'm tired to disconnect from network)
I had a problem like this. It helped me - symfony account:logout
Here I found the answer - https://github.com/symfony/cli/issues/281
edit by Alexandre: I only had to logout from cloud. Because of the firewall rules, symfony detected that Internet was available and try to get a new token, but fails because of firewall rules.
Now I only have to disconnect from cloud when I am connect on enterprise network:
symfony account:logout
If I got this right, you want to start your server only locally right?
symfony serve -d
The -d flag starts the server in the background. You might want to install the certificate in order to serve https:// with the following command: symfony server:ca:install. Both commands are issued inside the root directory of your project.
Once you're done, go into the root directory where you started your server and type in this command to stop the server: symfony server:stop
This should give you a local web server with your symfony project.
FYI: In case you have installed several PHP-Versions you might need to pick a specific one by saving a .php-version file to your root directory:
For any 7.x version:
echo 7 > .php-version
For 7.2 version:
echo 7.2 > .php-version

Apache could host a web server but "php -S" can't

I'm new to web development.
I installed Apache and PHP separately, not using XAMPP. Then I notice that after I create a PHP project, I could put it into htdocs folder and launch httpd from Apache and working fine. But if I use php -S localhost:80 -t my_folder, no matter which port I'm using, I can't access it via any browser or cURL.
My computer is running Windows 10 with Anniversary update and ZoneAlarm. I'm not quite sure if these information are related. Please let me know if I need to provide more information to identify the problem.
Thanks!

How to unbind the php built-in server from a directory?

I created a local WordPress site and in XAMPP set it up with Virtual Hosts so the address test-wp.dev was the home adress. All was working fine and then for some reason I decided to turn off apache, leave mysql on and try the build in server.
So I navigated to C:/xampp/htdocs/test/wordpress/ and ran php -S localhost:8080
It worked fine. However, today I went to go back to test-wp.dev using the Apache server and it keeps redirecting to localhost:8080. I don't want to use the built in server now. I want Apache.
Where do I "unbind this" or free up that port or whatever. I don't want to have to run the built in server for that folder anymore.
Thanks.
Windows 7
PHP 5.6

Can't Log into MySQL using phpMyAdmin

I installed IIS7, MySQL 5.5 and PHP 5.3 on my desktop running Windows 7 Ult 64-bit to develop a website and in order to test *.php webpages locally without having to upload them to my web host.
Everything has been running fine for several months until recently. When I try to log into MySQL database using phpmyadmin the webpage just clears the username and password and stays at the log in page. Even when I enter an incorrect username and password it doesn't say the log in credentials are wrong, it just stays at the log in page. Not even my root username and password will work.
I tried doing a manual password reset as explained on other forums but that didn't get me passed the log in page.
My database is only a test database so I even went as far as uninstalling and reinstalling MySQL. This installed the newer version of MySQL 5.6. That didn't work.
I tried different versions of phpmyadmin from 5.2 thru the newest version 5.7. I changed PHP in IIS7 to PHP 5.4 but that didn't get my log in to work either.
All webpages in *.php open fine on the localhost machine. I can view them fine. I run home server and when I access the website from a remote computer I can navigate the entire website. When I go to http://[remotecomputername]/phpmyadmin and try to log in it just goes to a blank page and doesn't show me the phpmyadmin gui.
Not sure why the log in on the localhost stop working but any help to resolve this would be appreciated.
go to control panel > administrative tool> service >
then you will find a list of item , navigate to MYSQL
right click on it > properties > in general tab > start type ( make it automatic )
then apply / save
and finally restart all services in wamp

Categories