I have a VPS of blueMix, My cPanel's file Manager have folder public_html where i dropped a file index.php having some php echo 'tesing'; which wasn't loading up, After some research i found out that my root Directory is /var/www/html. But any how i dropped my project there like /var/www/html/project and then came up checked like example.com and that redirected me to the hosting default page, example.com/project show project root files and folders, example.com/project/public returned internal server error 500. Permissions seems ok.
What am i missing, Is there a slandered way ? Please help out.
Q1 : How can i set my root directory public_html.
Q2 : How to deploy laravel in /var/www/html or public_html.
modify this Lines from Public->index.php to the public_html .
require __DIR__.'/../public_html/bootstrap/autoload.php';
$app = require_once __DIR__.'/../public_html/bootstrap/app.php';
and check..
After hours of research, I easiest way is to have a server with out a lamp stack, Install a custom lamp stack, One by one component, Look for the apache configuration, Set the permissions, And you are good to go.
Related
I have created a website in a LAMP using Apache MySQL and PHPmyAdmin, I have migrated this website and is db to a similar configuration but and Windows. And my directory are all mucked up. from index I am able to access any file in root location but if it is in a folder I have to had a ../../htmlwhere I previously had ../I have a lot of folder and a lot of header(Location: ../whatever) using them. How can I fix the directory ?
This is my root in var/www/ :
And this is inside the html folder (var/www/html) :
Laravel's documentation does not explicitly say where to execute "laravel new project_name"? Should it be executed at the webserver's root that is htdocs or www? I use WAMP server in Windows.
It should be executed at the parent folder of htdocs or www.
The laravel folder can't live in htdocs, as it will expose all sensitive files.
After that, you must map laravel_myapp/public to something as htdocs/myapp.
You can also symlink the laravel_myapp/public folder to where you want in htdocs.
Depending on your needs, but I would put it in htcdocs/www because is the default folder configured in apache by WAMP, anyway you can change the documentroot of your server if you want.
As long as you have the right folder permissions and the project is created under your root folder laravel shouldn't have any problem with that.
Hope this helps you :)
I have installed the laravel 5 on my local machine.And made the changes in the database.php file in config folder.I have set my credential.Now I am accessing the folder http://localhost/laravel/public/ but it displays html page with this content. Whoops, looks like something went wrong.What configuration should I set apart from this database.php so that it works fine.
This will likely happen to you everytime you create a new Laravel project. The problem is that your webservice (apache/nginx) doesn't have read/write permissions for the storage folder. From the root of your installation perform a chmod 777 -R ./storage and that should get you to the welcome to Laravel screen you should expect for an installation, and from that point on you should now get the error reporting if you have debug mode set as true. If you are still having trouble, you may need to provide access to the ./public folder as well.
You can run laravel application when you have successfully installed in your machine, Add '/public' in url after root folder. Means you have installed app on www.firstlaravel.com and your root folder is 'first'.
So you can run app using like => www.firstlaravel.com/public
So I'm new to Laravel 4, and I'm trying to figure out how to Symlink two parts of my site.
The first is apps/storage
The second is public/cache (this is where an image cache is stored)
I'd like to move both of these to a SSD on my server, however Laravel keeps throwing out an error whenever I try and setup these Symlinks.
That error is:
ErrorException
file_put_contents(/meta/services.json): failed to open stream: No such file or directory
Clearly it's unable to find the filesystem and the symlink isn't working with Laravel. But the symlink DOES work with individual files (such as a jpeg), so I'm positive there is no problem with the initial setup.
To clarify, the document root is set to httpdocs/public (via Plesk settings)
The apps (and framework) are located in the httpdocs folder which is no longer serving as the vhost root.
As I hinted at, it's a Plesk server. The owner belongs to the vhost, and the group belongs to psacln. But I don't think there are any permission/ownership problems, as I've verified the symlinks are working.
Looks like you have messed something else, because the path in the error message looks wrong to me:
file_put_contents(/meta/services.json)
IMO, it should be something like:
file_put_contents(/var/www/webapp/app/storage/meta/services.json)
Because, if you have done the symlink correctly you did something like
mv /var/www/webapp/app/storage /mnt/ssd/
ln -s /mnt/ssd/storage /var/www/webapp/app/storage
PHP is trying to write a file in the root /meta folder, where probably it doesn't have right.
I installed wamp stack and then installed netbeans ide. The port number for apache is 100.
Created one PHP project at
C:\Users\aaa\Documents\NetBeansProjects\PhpProject2
and project URL http://localhost:100/PhpProject2/
When I click on run, I see the message "http://localhost:100/PhpProject2/index.php URL not found on the server".
What else I need to do to connect http://localhost:100/PhpProject2/index.php to C:\Users\aaa\Documents\NetBeansProjects\PhpProject2?
Please help.
You need to configure Apache's webroot to be C:\Users\aaa\Documents\NetBeansProjects (search for DocumentRoot in the file httpd.conf).
Or you can move/copy your files to the existing webroot, which may be something like c:\wwwroot.
Apache doesn't just magically know where you put your website files, and setting the URL inside NetBeans doesn't actually configure the webserver (I think it's just so that auto-generated links are right).
If you go to http://localhost:100/, what do you see? What is your web root? The folder needs to be in your web root, and I would be surprised if it is C:\Users\aaa\Documents\
I did a Google search for "wamp stack" and found a product by Bitnami... if this is the one you are using, the default web root is C:\Program Files\BitNami WAMP Stack\apache2\htdocs\. If that is indeed the case, then you'd need to move the NetBeansProjects folder to there. (source: http://bitnami.org/files/stacks/wampstack/5.3.6-0/wampstack.pdf page 7)
You need to look into aliasing. That will let you more or less assign directories in the url path to arbitrary directories on your file system.
You have to move your files to your root folder of the Apache installation (htdocs). You should refer to your WAMP installation for where that is located. Personally, I like to use XXAMP for installation.
Netbeans is just an IDE, it doesn't serve the files.