I have a Symfony2 project setup in /var/www.
Because I want different users working on the same project, I copied this project to their directory and changed the name of the database for example. I did that so they can test their changes on the server rather than installing wamp locally on their machine. Those changes will then be committed via svn/git.
However, the problem I am facing now is:
Because I copied the Symfony2 project to their own directory (e.g. home\mike), the user or I can not execute a php app/console command, because it is still refering to the one in /var/www.
So for example, when I do:
sudo php app/console doctrine:schema:update --force
This command will be executed on /var/www/Symfony rather than on home\mike\Symfony
How can I refer it to his own directory?
Thank you.
At first, try to manually clear cache in your new project path.
Then, check this article, about migrating project: How to override Symfony's Default Directory Structure
Each project has it is own structure and the command.
If you have symfony on www you must have the console file under app
Related
Five months ago I created a pretty extensive Laravel Blog Management system. I am now at a point where I am looking for a job and would like for potential employers to be able to easily install and run my project to check it out. I want to include instructions in the readme.md on how to get it started but I've just realized that I can't figure out how to run it myself!
Here is the repository: https://github.com/colesam/Laravel-Blog
Here is what I've tried:
git clone git#github.com:colesam/Laravel-Blog.git
composer install
php artisan serve
This copied the repo into my xampp/htdocs directory and ran it. XAMPP is currently running with MySQL and Apache running.
The console responds by telling me it's being served on localhost:8000. Unfortunately I receive an error message on the actual html doc:
What is going wrong with my project and how can I make this as easy as possible for my potential employers / anyone who would like to download and check out my project?
It's really easy actually. Takes about ~5 minutes. Here are the steps:
Clone the project
Create a database
Copy .env.example to .env and set the correct database credentials
Run php artisan key:generate to generate the app key
Run php artisan migrate to create the tables
Run php artisan serve
And you're done.
I'm still really new to Git version control and Laravel. But I have gotten so far, and I'm not sure now where I am going wrong.
I set up VirtualBox and Vagrant on my local windows machine and installed homestead successfully. I have managed to get my Laravel website (it's only one page at the moment as I learn things) working correctly, it displays the header and the footer and the images load and everything. So that's all good.
So now, I have my Laravel website set up within my virtual vagrant server. On this server, the directory for my website is:
/home/vagrant/Code/sites/public_html
No when I cd to that directory, I ran the following:
git init
get remote add origin https://user#repo/user/publichtml.git
git add *
git commit -m "Initial Commit"
git push -u origin master
(I've substituted user#repo instead of the real URL)
All went through successfully. Great. So now on my live server I ran the following:
cd /home/sites/public_html
git init
git clone https://user#repo/user/publichtml.git
Which again, worked fine. It downloaded all the files into the public_html directory which is great. So then I go to visit the website and this is what I get:
The only explanation for this happening is maybe I need to install something on the server before I clone these files to it. I guess the files in the Laravel folder won't run by themselves? Do I need to install composer and laravel on the server or something? If so, how do I do that, and why don't they run on their own?
I cannot see a .htaccess or index.php in the root directory so I am not sure how it runs anyway.
You should install Laravel using composer instead.
composer create-project laravel/laravel mysite
You should also point the document root on your web server to laravels "/public" folder, making the framework code reside outside of the document root. That's good for security (no one can access any framework code, like your configs etc directly).
You will then find the .htaccess-file in the /public folder.
Please read the Laravel documentation about the different but recommended ways to install Laravel.
Btw, doesn't homestead use Nginx instead of Apache? In that case, .htaccess isn't even used. Please refer to the Laravel documentation again regarding homestead.
You need to redirect traffic to public/index.php instructions for this are webserver dependent.
I have a existing laravel project that I have been working on for a while now.
I have to put it in a test environnement to show it to my employer.
My problem is that I have no clue how to use my git repo of the project to put it on a fresh installation of wamp server.
1 - I have tried to install it as a whole but failed.
2- Then, I tried creating a fresh copy of Laravel base architecture (that worked) and after, replacing the files I modified on my existing project over on the fresh Laravel project. Turns out, it can not find my login.php page and I am stuck at that point.
So I want to find the easiest way to clone a git repo with an existing Laravel project directly on a wamp server and make it work.
I have been trying for several weeks, please help me.
Thanks
Okay, here are some simple steps to create a copy of your Laravel5 project on another server:
Setup the server (Databases, PHP and so on) and install Composer. If you are local, composer should already be installed
Clone the repository and copy the content to the htdocs or var/www folder, depending on your server system
Now execute composer update to load all dependencies
Last but not least, setup your .env file. Use the .env.example from Laravel5, add your credentials, generate a key with php artisan key:generate
That's it. Now your Laravel5 project should run.
I tried some solutions (ex: Transfer Symfony2 site onto localhost from web server), but never works, the result is always a blank page.
The project is on Symfony 2.3 and my php version is 5.5
Thanks
When accessing a Symfony2 site locally you need reference one of the routing files in the web folder directly. So try http://localhost/app_dev.php/ and it might give you an error message telling you what is going wrong. Also you can check the log files in the /app/logs folder to see what the problem might be.
Edit:
There are also several command line tools that might be needed to set up the project.
app/console doctrine:schema:update --force
This will check the database is in sync with your code and update the database if necessary.
app/console assetic:dump
app/console assets:install
app/console cache:clear
These are used to install css, javascript and other static assets as well as clearing the cache.
While installing laravel through terminal command, my other projects in MAMP htdocs folder got affected and they are not working.
I followed this process for installing laravel
Those directions have you symlink the "htdocs" directory to your laravel install, effectively making your htdocs directly useful only for Laravel.
You should avoid this, perhaps by creating a symlink from your laravel build to a directory within htdocs. For example, linking to a directory in htdocs called "mylaravelapp": ln -s /path/to/laravel-master /path/to/htdocs/mylaravelapp.
Lastly, consider using Vagrant or another virtual machine provider instead of MAMP for a server. You'll have to get through a learning curve (potentially), but you'll end up better for it. This creates a virtual server for you, which won't interact with any other parts of your Mac (YOu can make a server per project!).
Here is a guide to get started with Laravel 4 and Vagrant.