Laravel on sub folder - php

I am trying to install Laravel 5.3 in sub domain /public_html/mysite
but it's not working should I change .htaccess or what ?

Put the content of public (L5) directly on public_html (be aware of don't overwrite the .htaccess file accidentally) Now in then modify your index.php and your bootstrap.php and it will work just fine

I hope #Nino Armani gave you the right answer. Although you can try with visual video tutorial here-
http://www.tisuchi.com/upload-laravel-projecy-cpanel/

Move everything from project/public folder to project/ folder
Update index.php to have bootstrap path like "./bootstrap"
Add base APP_URL in your .env
Update layout folder paths like {{URL::to('/css/app.css')}}

Related

How to allow access to sub folders in laravel?

I have laravel installed on my server and I want to add a folder called 'projects' in laravel's root folder and access the projects folder from URL.
What should I do to solve this issue? I want to upload some PHP code demos and allow people to view them.
I have tried playing with the .htaccess but nothing seems to work for me.
public_path(); // Path of public/
base_path(); // Path of application root
app_path(); // Path of app/

Upload folder of Wordpress outside the project

I am trying to define the wordpress upload folder outside the installation directory. My directory structure is:
/path/to/my/base/folder
|-> wordpress (the wordpress installation)
|-> uploads (the required upload folder)
I have tried defining the 'UPLOADS' in my wp-config.php like:
define('UPLOADS', '../uploads');
Wordpress creates the folder and the images are uploaded there, but cannot use it when required. The image URL looks like :
www.myhost.dev/../uploads/image-file-name-format.jpg
But if I use absolute path to define the 'UPLOADS' like
define('UPLOADS', '/path/to/my/base/folder/uploads');
this works.
But the problem is, then the image url looks something like:
www.myhost.dev//path/to/my/base/folder/uploads/image-file-name-format.jpg
This tells the location of the file and this can be a security issue.
So, is there a better way to define the relative path for the uploads folder which will point to my required folder?
Thanks in advance.
I have done it at last by making a symlink with proper permissions. In my case, when I tried to make a symlink, the symlink did not have enough permission to write into the folder. This was because of my system (I am using Macbook). So what I did is:
$ cd wp-content
$ mv uploads /path/to/my/base/folder/
$ ln -s ../../uploads uploads
$ chmod -h 777 uploads
Check the last line where I have changed the permission for the symlink. Normally in most of the cases, you don't need to change the permission of the symlink, as they inherit the permission of the folder.
A couple of notes that may help people:
define( 'UPLOADS' , 'blah') is typically RELATIVE to the WordPress core root directory. The default is 'wp-content/uploads'. If you try to put the uploads outside of the WordPress directory with something like '../uploads/' as the define the upload URL will typically not work causing problems.
If you set the path with the define() inside your wp-config.php WordPress will NOT read the upload_path setting, if you have used it.
I found that setting the upload_path option in WordPress is better for storing media files outside the WordPress install path. Login to your WP Admin and go to the url /wp-admin/options.php to see the "raw" options list for WordPress.
Look for the upload_path setting. Put in your FULL PATH on the server like /usr/wpsite/uploads/ where /usr/wpsite/public_html would be where your WordPress core install typically ends up. Save the settings.
Your uploads will now be placed OUTSIDE the WordPress install directory. Make sure the web server has read/write permissions to the directory.
Also note that WordPress will put ALL FILES in that directory. It will not separate them into year/month subfolders as is the default for a typical WordPress install. If someone knows how to retain that feature please comment.
If you take a look at this link http://www.wpbeginner.com/wp-tutorials/how-to-change-the-default-media-upload-location-in-wordpress-3-5/
You need to use a path like so
define( 'UPLOADS', ''.'uploads' );

issue in calling css file in cake php

How to call css or js file from
/app
/webroot
/bootstrap
/bootstrap.css
if i added
echo $this->Html->css('bootstrap');
code in view/Locale/default.ctp its working fine .. but bootstrap.css file not taking from bootstrap folder .
If i copied bootstrap.css in webroot/css folder its working fine ..
I am fresher for cakephp . Can anyone help me to resolve issue
The path that you provide in $this->Html->css() is the path of webroot, If you have a sub-folder under webroot, and the css file is in the sub-folder,you have to specify the sub-folder name, like this:
$this->Html->css('bootstrap/bootstrap');
use this hope this Help
$this->Html->css('/bootstrap/bootstrap');

Laravel 4.2 remove /public from URL

I've seen many people posting here on how to remove the /public folder from URL.
E.g. http://some-domain.com/LaravelProject/public/index.php
It's simple. Suppose your Laravel project is in LaravelProject directory. Copy the server.php in the same folder as index.php.
After that, copy the .htaccess file from public folder in LaravelProject, i.e. your Laravel root folder. It should work!

Hosting a zend framework project on a shared host

I need help in hosting my zendframework project.When i host it i can only view the home page but i cannot navigate to other pages. I think it is something to do with the .htaccess file.
my directory structure looks like this:
.public-html
.htaccess
.myproject
.applicaton
.public
.library
.tests
i will be very graetful for any assistance.
Based on the directory structure you posted, it looks like your .htaccess is in the wrong place. Move it into the public folder and try again. (Your .htaccess file should be in the same folder as your index.php file, per the Recommended Project Directory Structure.)

Categories