I want to set up the environment for my laravel project to work using a simple method. Apache is so far giving me some trouble in that the home page is not loading and throwing an error.
I have setup an Apache virtual server which is not working as expected.
No codes related to this one.
Set up the environment for my laravel project using
Related
Though I'm famillar of how MVC works I'm a novice Laravel Dev.
After reading the installation docs, and succesfully started it's server. (i'm not using homestead) I was wondering if i could use my own web server (easyphp) to run laravel localhost instead of it's own mini web server. Can I do that without running the command php artisan serve?
You can run laravel anywhere, it's nothing special. Though as you would know you should redirect it's rootdirectory to / public which can be done by virtualization or using some htaccess file. Both are really easy to do and should work right away.
I am setting up a Laravel 5 openshift application but every time i had the database code in project it says whoops something missing. I have added the environment in .env as in my database credential an still no success. I am wondering what may be the cause of this since I followed all instruction the website is working but only if I omit my database code.
Are you trying to get your database working for local or remote development? The .env file in the root directory is for local development, while the .openshift/.env file is for remote development. If you're using an standard OpenShift database (such as MySQL or PostgreSQL), you shouldn't need to make any configuration changes to get the database working. It's already configured via environment variables.
Problem: I want to access environment variables through HHVM that aren't typically exposed to a default php setup
Context: I rely on a couple of system variables to provide dynamic configuration options to a Laravel4 project running in a Docker container. I want to connect to a mysql DB running in another docker container that exposes a random IP address on startup. This IP address is passed into the Laravel4 container using --link options for Docker and automatically exposed as a system variable in the Laravel-4 container.
Previous approach: When using php-fpm, I could expose system variables created by Docker to php using the www.conf file like so, and then just use getenv('VAR_NAME') to get the variable in my php code.
However, with HHVM, I cannot figure out how to access a "non-standard" environment variable. There seems to be no equivalent to www.conf that I can locate. Has anyone attempted this before? Is it possible to access system variables that are external to PHP using HHVM? Is there something specific to HHVM's configuration and I just can't find it in the docs?
Additional Info: I am behind Nginx here. I don't think fastcgi-param directives will work in my case, but I may just be doing it wrong. If anyone has accomplished what I'm trying to do using fastcgi-params, I'm fine with that approach also.
fastcgi_param should work the exact same way in HHVM (assuming you are using HHVM as a fastcgi server, which you should be).
I generated the default RoR application with the rails new <project_name> command, and everything seemed to go fine. Later I decided I wanted to relocate my rails projects in a different directory (something other than my home directory), so I moved the RoR project to /opt/rails/<project_name> and I created a symlink in my web root pointing to /opt/rails/<project_name>/public, and the page loads fine, but some of the assets aren't loading on the Welcome aboard page, i.e. the rails.png And when I go to click on the About your application's environment link I get a 404 error. If I had to take a guess as to why I'm getting these errors it would have to be that I moved the rails app simple_cms from /home/user/www/rails/simple_cms to /opt/rails/simple_cms Is there a command I need to issue in the project root of simple_cms to get things fully working?
Update
I'm using Apache 2 as the web server on a CentOS 5.9 box.
If you are using rails s to launch your app, then there is no need to create symlinks. The web server (could be WEBrick, or Thin) will serve the application from the app root.
If you are using Apache or Nginx, again there is no need to create symlinks, but you need to let Apache/Nginx know the new location. For example, in a Nginx+Passenger setup, you would need to set passenger_app_root to the new location.
Provide more details in your question, or consult the documentation for your setup.
I've been looking into using mod_rails (Phusion), but I just wanted to verify this: Once it's installed, I can still serve regular, non-rails apps from the same server without making any changes. Is this correct?
It is correct. I'm using Passenger in a project with other PHP projects and it works fine (even some PHP files in your public folder).
You can also set the passenger to start standalone (passenger start -d in your rails root folder) and use the mod_proxy and mod_rewrite from Apache to handle it (redirecting the rails requests to the rails app).
Yes, you can still serve non-rails applications using the same server.
mod_rails automatically detects which DocumentRoots are Rails applications by looking for public, for example.