how to run php artisan migrate from within my virtual machine - laravel-5

I've just started with Laravel, installed on WAMP server, and when trying to migrate the first tables, I get and error saying that homeasted#localhost user has no premission, but I dont know how to change it to work on my virtual machine. What should I do?

Please check out Laravels Homestead – it is easy to setup and provides you with a webserver, ready to use and pre-configured for Laravel.
But if you want to use WAMP, you have to:
1) Create a database for your new Laravel installation. Go to your local phpmyadmin, which comes pre-installed with WAMP Server. Login to your database (default username should be 'root', password is blank). There you can manage your databases. Go ahead and create one for your Laravel installation. (There are many tutorials about how to create a database with phpmyadmin)
2) Go to the root directory of your Laravel installation. Open the file called .env.example and fill in your database settings. Then save it to .env. This should get your database connection up and running. Read more about .env in the laravel docs.

If you're using Homestead, you do not need WAMP server. To run migrate command, you need to run vagrant up to start the VM box and then run vagrant ssh command to run SSH. Only after that you should run php artisan migrate command.

Please check here i think that can help you.
https://laracasts.com/discuss/channels/general-discussion/homestead-db-connection-problem

well you can change the table name in .env file which is present in the root directory
If it is not present in there (as it is not available in laravel 5.2) please download it.
Enjoy

Related

Install Magento 2.1 with MariaDB

Current system installed is using MySQL, going forward we decided to move from MySQL to MariaDB. MySQL service has been stopped and created new DB using HeidiSQL which comes after MariaDB installation.
Now while installing Magento 2.1, I am facing below error.
How do I install Magento 2.1 with MariaDB ? Currently I am using WAMPP server.
try using localhost as the hostname in the configuration
also, try creating a new user for your database with host %
You probably need to set-up your firewall settings and open up ports for MariaDB (SQL during installation does that for you, so you didn't have to do it manually). Also add another user with privileges you need, it's never smart to use root for all of your access.
You can follow some steps on this link, for configuring remote access. It should be the same for the local configuration, at least the same ports.

Laravel continous development for production site

I develop a laravel site in localhost. I'm very interested in the best way to migrate database to production site without losing current data.
If you are using phpmyadmin you can just export the database. It will create a .sql file. Then you need to go into the phpmyadmin of your server and import this .sql file.
You can just save local database with mysqldump to file on the localhost and restore it from dump on the remote one, using ssh (by mysql host database < dump.sql) or phpmyadmin kind of tool.
Backup your database and storage;
Use a git repository- BitBucket or GitHub;
Any more information on your production server? Development Server?
Example: XAMPP, WAMP, or other local server
Are you going to use LAMP?

Setup Laravel 5 Application without command-line access

Is it possible to Setup Laravel 5 Application without command-line access?
It's a common task do these commands with Laravel 5:
composer install
php artisan migrate
php artisan db:seed
gulp
[...]
Consider a non-dedicated server without SSH access, how can I setup the application in that environment?
Yes it is possible.
Briefly, when you have developed your Laravel on local environment you need to use FTP client/software (Like FileZilla FTP client) to upload the content to your host provider.
Before that you need to ensure some technical details so it can work
Ensure have write permission to folder Storage.
All Laravel folder should be upload, but the domain should point to Public folder.
You need to configure your host MySQL database information in your project.
And it should work, the only challenge left here is to ensure you find host providers that allow make modifications on 1 and 2.
I suggest you to try it before distributing it to your customers and make a step-by-step guideline, as there is risk for unseen scenarios.
In addition to my answer, few links for reading:
http://novate.co.uk/deploy-laravel-5-on-shared-hosting-from-heart-internet/
https://medium.com/laravel-news/the-simple-guide-to-deploy-laravel-5-application-on-shared-hosting-1a8d0aee923e#.vv4wgkdrw
Deploy Laravel 5 using only FTP in a shared hosting

How does Codeigniter know where mysql server is located?

I know this is a very newbie question. So supposed we have a wamp server installed, and downloaded codeigniter. Does the codeigniter find the mysql application through the environmental variable path like it shows on the phpinfo() page? If possible, could you tell me where I can see this configuration within the codeigniter application. The database.php file doesn't seem to have mysql path.
You have to define mysql credentials within application/config/database.php, so codeigniter can connect to your database.
To connect no path is required, instead you have to provide host, username and password.
In your case:
host: localhost
username: root
password: your default root password
Read here: https://ellislab.com/codeigniter/user-guide/database/configuration.html
In general, MySQL server is to install as a Windows Service (Daemon on linux), it can be controlled from the command line, or with the graphical services utility.
PHP interacts with MySQL by connecting to it using TCP/IP. So needless, we have to provide
credentials like hostname, port(default 3306), username ,password etc in order to connect with it. More details can be found here.

Copying an existing Magento site to run locally

I am having a hard time running my Magento site website locally using xampp. I have downloaded everything in the public_html to the htdocs folder. It is giving me a n error when i load
SQLSTATE[HY000] [1045] Access denied for user 'mySite_magstore'#'localhost' (using password: YES)
I loaded up the phpmyadmin panel to check the password but it is not loading the one from my website but the new one i have locally. I'm sure I am missing a step here as well.
All the information I have found online is regarding setting up a new site on xampp but could not find anything about using an existing one. Any help or links would help.
Thanks!
If you want to create a test environment in your machine, try the following steps:
Export your live DB
Import it in your local machine
Go in to the core_config_data table and change the 'value' of:
web/unsecure/base_url
And:
web/secure/base_url
To:
http://127.0.0.1/
Go in to:
app/etc/local.xml
And change the username and password to the correct ones
Edit:
Thanks to Cooper Maruyana for bringining this up:
If the previous step doesn't help delete everything in the 'var' folder.
Check your app\etc\local.xml for below line
<password><![CDATA[]]></password>
I am sure you have set some password for production server, but on your local you don't have any password for your root user. So you need to remove that password and also set you base URL in core_config table.
There are two possible options: one is to copy your database from your server to your localhost as pzirkind has illustrated in his answer.
The second option in case you want to use exactly the same database, i.e. you WANT to use your live database:
You need to adjust your app/etc/local.xml file to point to the database server IP address. Currently there should be "localhost" in there. Remove that and put the database server IP address. If you have setup the user on the database to allow remote access (% for scope in phpmyadmin), then this would work, too.
However, I would not recommend this option. I only use it sometimes to share a database between development and staging areas, but never for live sites.
Therefore, I would highly recommend pzirkind's approach!

Resources