I am creating a pagodabox app in codeigniter , In this app i used uploads folder to store the images, now i need to create a sub-folder named "thumb" to save thumbnail of uploaded image.
my problem is that directory is not created on server. Any help is appreciated
Probably you need Pagodabox writable storage:
https://pagodabox.com/features/shared-writable-storage
As far I know, pagodabox uses git for source control, right? If so, why don't you just create new directory on your local repo and commit/push it? That should do the work fine. Also, pagodabox's hook file should help you set directory write permissions as well.
Git ignores empty directories (actually ignores folders in general).
Make the directory in your local repo, and create a file in it. You can delete this file later or add it in .gitignore.
Related
This is Bablu Ahmed. I want to upload my laravel 5.5 project into cpanel and my domain is an addon domain name is w3public.com and it's root directory is not inside the public_html it is outside the public_html (www.w3public.com). I have separated the project's files into two directories, one is www.w3public.com and another is laravel and I moved public folder's files into www.w3public.com and all other files into the laravel folder in cpanel that is given in screenshot below. I have also modified the index.php file of www.w3public.com as follows:
require __DIR__.'/../../laravel/vendor/autoload.php';
$app = require_once __DIR__.'/../../laravel/bootstrap/app.php';
But it is not working. Can anyone help me with appropriate solutions?
Screenshot:
Your application should be installed in www.w3public.com and then change the root path from cpanel domains to the public folder inside laravel.
The best way to transfer files is git or the likes, but if they don't have it (usually is the case in shared hosting), you should use a ftp client, and if they don't allow that either, you can upload files/folders from cpanel (way too slow sadly).
If you use git be careful since by default vendor folder is in the .gitignore (you have to run "composer update --no-dev" after all the files are transferred)
Make sure also that your ".env" (usually in .gitignore too, so you prob have to make one) file have your server database info.
Hi I have my website which its my resume and now I want to show the project that I have done one of my project is laravel and I move it to: public_html/laravel
and also move my DB to there but I get this error:
403 Forbidden
You don't have permission to access /laravel/ on this server.
I don't understand is it because of I didn't put files on main public_html and move it to folder or other stuff I also changes(i don't know if its right) change config/database.php mysql part to database configuration but I keep getting this error
Laravel server files from the public/ directory. So try a URL like this instead:
http://example.com/laravel/public
If that works, you'll need to move some files around a bit. This should help with moving things around:
How to change public folder to public_html in laravel 5
If you use shared hosting then please do not uplaod whole laravel application to the publitc_html folder. You have to upload your all application at global document root for your domain like home/yourdomainand you have to rename existing public_html folder to any name and rename laravel public folder to public_html and try again. See the image below:
I am using Cakephp3 and would like to know if there is a better alternative to relocating the config folder.
The issue rises from the fact that everytime I have to refresh the production app, i copy over the entire app from development to production and reconfigure the required settings in the config folder.
After some iterations of this process, I started to make a backup of the config folder and after copying the app, restore the config folder.
After some time even this started to get tedious, so I ended up hacking the cake files and folders.
I relocated the config folder outside the root directory
Created a symbolic link in the root directory poiting to the config directory outside the root directory.
Updated the ROOT constant in config/paths.php to the real root folder
In webroot/index.php redefined the bootstrap.php require location
So as long as long as I dont update the cakephp core, I can copy over the dev app to the prod app and all the config stays the same.
I would like to know if some one has a simpler approach.
Thanks
After some research and reading carefully the comments in related bootstrap file, I found a solution for, well at least, my problem.
The problem basically was that I had to refresh the database, email, debug settings define in the app.php file, everytime I uploaded the app from my dev server to my prod server.
Reading the comments in the bootstrap file I found the comment which stated:
Load an environment local configuration file.
You can use a file like app_local.php to provide local overrides to your
shared configuration.
So this allows me to redefine the configurations defined in the app.php file. However I wanted this to me more dynamic, so I ended up creating an APP_INSTANCE_NAME constant in the bootstrap.php file of the webroot directory as follows
// /config/bootstrap.php
define('APP_INSTANCE_NAME', strtolower(gethostname()));
and later in the bootstrap file, i did the following:
Configure::load('app_' . APP_INSTANCE_NAME, 'default');
with this change, the configuration that gets loaded is based on the server hostname and I dont have to relocate the config folder. Hope this helps someone with cakephp3
Thanks to jason and greg's comments which motivated me to read the comments more carefully.
I'm using AWS S3 image upload in my project. For that i'm using graham-campbell package (https://github.com/GrahamCampbell/Laravel-Flysystem/tree/1.0) with Laravel 4.2. In that i can copy single file from one place to another. I can't move all files from one folder to another folder using Flysystem. Anyone have idea, pls shae with me.
Flysystem::copy(string $path, string $newpath);
I know it's not specific to the package however look into how S3 actually works, https://github.com/aws/aws-sdk-php/blob/master/docs/service-s3.rst
Also look in your error logs to see what the issue is.
If you setup your document root as C:\xampp\htdocs\ and you create a project folder named "ProjectX" where you include all your project files and folders and subfolders, how are you going to make your project runnable with url "http://localhost/projectx" ? I would like to learn how your config and routes files you included in your projects are changed ?
you can refer below link
http://book.cakephp.org/1.3/en/view/912/Installation
cheers
I would not run them as "localhost".
If you link css/js/img absolute to the / root, you will run into problems later on your life server.
it is always best to use virtual hosts and simulate the "real life" on your system:
http://www.dereuromark.de/2011/05/29/working-with-domains-locally/
You can create a folder projectx in C:\xampp\htdocs\
Then copy all the CakePHP files in C:\xampp\htdocs\projectx\ (including .htaccess, app\, lib\ and all. Setup the salt, cypher, db files and you should be able to access it through http://localhost/projectx/