I have installed Laravel 5 following this tutorial for installing Laravel 4 and have got a test site up and running on localhost:8888
using PHP's built in server as the tutorial explains at 5:05.
I would like to achieve a similar thing but serving the site through xampp with a root of http://localhost/laravel
or something similar. My reason for this is that I have lots of other projects and databases set up in xampp and for now I would like to keep my development environment consistent.
I am running OSX Mavericks with PHP version 5.4.30, my editor is Coda 2. I have created a MySQL database in xampp and added the necessary details to my projects .env
file but can't get the site showing.
UPDATE: Apparently all I had to do to serve the site was restart my servers on xampp and add /public
to the end of my root url to see the site. however now I am faced with another problem. When I try to migrate the database...
php artisan migrate
I get no effect but the following message spat out...
exception 'PDOException' with message 'SQLSTATE[HY000] [2002] No such file or directory' in /Applications/XAMPP/xamppfiles/htdocs/laravel-test/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:47
Stack trace:
#0 /Applications/XAMPP/xamppfiles/htdocs/laravel-test/vendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php(47): PDO->__construct('mysql:host=loca...', 'laravel-user', 'YdVNRS5fDbJMLh6...', Array)
#1 /Applications/XAMPP/xamppfiles/htdocs/laravel-test/vendor/laravel/framework/src/Illuminate/Database/Connectors/MySqlConnector.php(20): Illuminate\Database\Connectors\Connector->createConnection('mysql:host=loca...', Array, Array)
#2 /Applications/XAMPP/xamppfiles/htdocs/laravel-test/storage/framework/compiled.php(10598): Illuminate\Database\Connectors\MySqlConnector->connect(Array)
#3 /Applications/XAMPP/xamppfiles/htdocs/laravel-test/storage/framework/compiled.php(10594): Illuminate\Database\Connectors\ConnectionFactory->createSingleConnection(Array)
#4 /Applications/XAMPP/xamppfiles/htdocs/laravel-test/storage/framework/compiled.php(10512): Illuminate\Database\Connectors\ConnectionFactory->make(Array, 'mysql')
#5 /Applications/XAMPP/xamppfiles/htdocs/laravel-test/storage/framework/compiled.php(10467): Illuminate\Database\DatabaseManager->makeConnection('mysql')
#6 /Applications/XAMPP/xamppfiles/htdocs/laravel-test/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php(167): Illuminate\Database\DatabaseManager->connection(NULL)
#7 /Applications/XAMPP/xamppfiles/htdocs/laravel-test/vendor/laravel/framework/src/Illuminate/Database/Migrations/DatabaseMigrationRepository.php(135): Illuminate\Database\Migrations\DatabaseMigrationRepository->getConnection()
#8 /Applications/XAMPP/xamppfiles/htdocs/laravel-test/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php(371): Illuminate\Database\Migrations\DatabaseMigrationRepository->repositoryExists()
#9 /Applications/XAMPP/xamppfiles/htdocs/laravel-test/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(101): Illuminate\Database\Migrations\Migrator->repositoryExists()
#10 /Applications/XAMPP/xamppfiles/htdocs/laravel-test/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php(54): Illuminate\Database\Console\Migrations\MigrateCommand->prepareDatabase()
#11 [internal function]: Illuminate\Database\Console\Migrations\MigrateCommand->fire()
#12 /Applications/XAMPP/xamppfiles/htdocs/laravel-test/storage/framework/compiled.php(922): call_user_func_array(Array, Array)
#13 /Applications/XAMPP/xamppfiles/htdocs/laravel-test/vendor/laravel/framework/src/Illuminate/Console/Command.php(115): Illuminate\Container\Container->call(Array)
#14 /Applications/XAMPP/xamppfiles/htdocs/laravel-test/vendor/symfony/console/Symfony/Component/Console/Command/Command.php(253): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /Applications/XAMPP/xamppfiles/htdocs/laravel-test/vendor/laravel/framework/src/Illuminate/Console/Command.php(101): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /Applications/XAMPP/xamppfiles/htdocs/laravel-test/vendor/symfony/console/Symfony/Component/Console/Application.php(874): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /Applications/XAMPP/xamppfiles/htdocs/laravel-test/vendor/symfony/console/Symfony/Component/Console/Application.php(195): Symfony\Component\Console\Application->doRunCommand(Object(Illuminate\Database\Console\Migrations\MigrateCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /Applications/XAMPP/xamppfiles/htdocs/laravel-test/vendor/symfony/console/Symfony/Component/Console/Application.php(126): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /Applications/XAMPP/xamppfiles/htdocs/laravel-test/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(91): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /Applications/XAMPP/xamppfiles/htdocs/laravel-test/artisan(36): Illuminate\Foundation\Console\Kernel->handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#21 {main}
Does anyone know how to solve this issue?
Thanks
Dan