laravel 5 showing directory structure in vps - laravel-5

I have installed Laravel 5 in my vps form the instruction given in the "http://laravel.com/docs/5.1" link. It installed successfully but when I go to http://myipaddress/laravel it showing me the directory structure. I had check my php.ini file also for the "mod_rewrite" and it is showing in the loaded package, so where I am going wrong.

Access the public folder. That's where all your output content goes. http://myipaddress/laraval/public/
Edit:
One other thing. Don't name your project "laravel" as it may cause naming problems. Try to create a new project with a different name.

Related

Configuring Laravel project in DirectAdmin server

I'm a newbie to Laravel projects but I need to have one accessible over the internet so I tried using DirectAdmin but whenever I go to my domain I get an index (pictures attached).
I renamed the Laravel 'public' folder to 'public_html', is that correct? Here is my file structure.
Here is what I get when I go to my assigned domain which isn't my website at all.
The webpage should look something like this
I also found a laravel app using Softaculous linked here (https://panel.freehosting.com:2222/CMD_PLUGINS/softaculous/index.raw?act=software&soft=419). Am I required to use this app?
At first, you need to learn about the laravel directory structure. You don't need to change the laravel public folder to public_html. I am not sure how the DirectAdmin server works. but if you see a laravel directory instead of serving an application it's might be a path-related issue in your server. your domain should serve your application public folder.
I just found a tutorial for the DirectAdmin server with laravel. that might help.

Unable to publish views or routes into my project directories

I just purchased a fresh Nova license and finished up with the installation. It's going all as expected besides some files/folders which I am unable to publish such as routes or views. There is a file(login.blade.php) stored inside the /nova directory which I want to modify the html/css but I am unable since the nova folder is stored inside the .gitignore. Also I want the routes as well to be published but no matter how much I searched there seems to be no answer. All help is appreciated

Laravel missing composer.json

I've pulled a client's project from FTP and web has structure as follows:
error_docs
httpdocs (where laravel files are stored)
logs
So I've pulled files inside httpdocs to a folder and updated the homestead.yaml and hosts file accordingly, and everything works fine, like it does on the website.
The problem I'm facing is that the folder structure is somehow different from what I'm used to on Laravel, and composer.json is missing, which as a side-effect has that I can't for example create new controllers.
[ErrorException]
file_get_contents(/home/vagrant/Code/my_project/composer.json): failed to open stream: No such file or directory
If I create one manually, I can't make a composer update or something similar, so the controller never gets registered in the project, and is as if I've never created it.
I tried running a composer init and then composer update which results in removal of all dependencies, and crashing the project.
Does anyone know how can I resolve the issue?
EDIT:
The project also has public folder empty, so I ended up mapping homestead.yaml like this:
- map: project.dev
to: /home/vagrant/Code/my_project
EDIT2:
Just found out it's a bought template from a web...still no update
So you basically downloaded a project from a shared hosting right?
Ask your client about source control / version control tools like Git if they use one and download the project from the repository.
Also, don't run composer update but run composer install and if you downloaded the project together with the vendor file, you shouldn't need to install the dependencies or update them.
Go to the laravel's github repository and download the default composer.json file just so you can autoload the classes and files.
The public folder is most likely empty because shared hostings use public_html as a default folder. Map everythng to it and change the code in your laravel application to point to public_html instead.
Laravel does not have support for shared hosting, but you can hack it up and make it possible only if you have composer available on that shared hosting server / console / cpanel, because some shared hostings are way too limited with it.
If you have to pay for extra support like server access, you are better off going with DigitalOcean which is a VPS and you have better server access there.

External PHP Include in Laravel

We run a main website which is not made in Laravel. A specific script on this website however is made in Laravel. We need this script (or to be exact, a specific view inside of it) to fetch some resources from the main website (PHP files which mainly include HTML). When, inside the Laravel application, we try to include these resources, we can not - as they don't exist in the Laravel project workspace. This results in an error that the file does not exist. Attempting to climb out of the project (../../../file.php) does not seem to help either.
We're including it this way:
<?php
include '~/template/nav.php';
?>
We don't wish to include this file into the actual Laravel project, as that would require having to update it twice to ensure they remain equal. Is there any way for us to include this "external" file in our view? Every bit of research done seems to suggest adding it into the project, which would just cause twice the amount of administration on updates.
Cheers!
Just faced same problem. My Laravel Project is an API that need's to include outside php file. So what I did was specify entire path:
include($_SERVER['DOCUMENT_ROOT'].'/../../my_example_file.php');
$_SERVER['DOCUMENT_ROOT'] will lead you to Laravel's public folder.

Joomla backend not shown correctly

I'm using Joomla 2.5 and the backend is not shown correctly. It seems that the template is not loaded correctly.
This is my page:
http://www.fussball.tsg-kastel.de/administrator/
The page as such is shown correctly but as you see, the backend isn't...
Try doing this:
Rename the admin templates folder on the host server (for a backup)
FTP transfer of an admin template folder from another Joomla site and then copy it from the FTP location using a file manager into the admin templates folder.
You could have a corrupt file or just missing some files from installation. This has happened to people before and by doing these two steps it seemed to solve their issue.
Hope this works out for you.
You probably have a fatal error. Go to configuration.php and change error reporting to development. This will render the error to the browser (alternatively check your apache error log). I predict you probably have a plugin problem -- perhaps your host updated PHP version for example. Whatever it is, deal with that problem.

Resources