more sites with cakephp in public_html folder live - cakephp

I have uploaded my company site (cake php) to live server's public_html folder
it is working fine
I want to create another folder named hr and want some static page in it
I have uploaded it, but accessing it as
www.mydomain.com/hr/mypage.html
it gives error of somethng like invalid controller
how to do this?

Put your folder hr inside as
public_html/app/webroot/hr
so it will be accessible as
www.mydomain.com/hr/mypage.html
hope this will solve your problem.

Related

How to create folders and images using AngularJS

I have an AngularJS app that, upon requested to upload an image, creates a folder inside the file system (CentOS) and then puts that image there, telling the user everything went OK or not.
Is this possible? All I've found is ways to download the file.
Thanks.
It is better to delegate this task to a service on the server, since it is file that is uploading to a server. I put simple rest service to file upload this file to the server.

Not loaded wordpress database on the live server

I move my site from localhost to live host server:
1. upload my wordpress website source to server
2. create a database and import localhost database
3. change 'home' and 'siteurl' option to domain name
4. copatible config.php with new live database information
but not load database and show /wp-admin/install.php page!
I try with Duplicator plugin and result is same.
I create another localhost website with this things but work correct!
enter image description here
This generally happens if .htaccess file is missing when you uploaded WordPress to live server. Hiddne file may have been missed when you copied your web pages to server.
Permalinks is another root cause of the issue.
Please check if you are able to browse your admin area directly: http://domain.com/wp-login.php. If so, login and go to permalinks settings. Do NOT make any change and click on Save directly.
This will create your .htaccess file and check your site again.

Multiple Domains/Sites connected to the same Database BUT one root folder for the UPLOADS, how?

I have multiple domains/sites that are connected to the same database and that are install on the same Dedicated Server. However, I like to have ONLY one root folder for the UPLOADS (like images, contracts, etc.) Example: right now if I register as an user on www.site1.com and I upload images, I am able to see the images uploaded to www.site1.com BUT NOT on www.site2.com or Vice-Versa.
Each domain has its own Applications folder as well as Admins. They share everything except for the UPLOADS, I don't know why but images are not been shared correctly. These are examples of how the UPLOADS are called in different files.
$config['base_url'] = site_url('performers/page/');
$upload_path = 'uploads/performers/' . $performer->id;
#unlink(BASEPATH . '../uploads/performers/' . $photo->performer_id . '/' . $photo->name_on_disk);
ANY THOUGHTS?
Try creating one folder for your uploads and create symlinks that point to that folder for every domain

How to download a file from CakePHP?

I'm working on a College Application project.
I want to ask how to download the files that previously uploaded by user.
Here's the clear view :
User will upload the files.
Controller will handle the request and save the name of the files into database.
How admin can download the file ???
I try to access the localhost/system/files/upload.doc but doesn't got any luck.
Consider using Media views: http://book.cakephp.org/1.3/view/1094/Media-Views
These will allow you to go to a path and load the database information about the file and then present the file with necessary download headers to the user.
yes use media views. They are the best way to keep your files from being publically accessible. So an admin can be "Served" the file and others can not get to them .
You can rename the file and things like that as you serve it to the user as well. Very nice feature of cake.

CakePHP: Shared Hosting Dilemma

I'm having trouble with uploading my cakePHP project on a shared hosting ( from hostgator ).
Here is what I have done:
I've organized my cake distribution like this:
home/user/app
home/user/cake/cake
home/user/cake/vendors
home/user/cake/.htaccess
home/user/cake/index.php
I have taken the content of webroot directory from app and put it in
home/user/public_html
I've modified this file home/user/public_html/index.php ( the one that was in app/webroot )
changing these lines like this:
define('ROOT', DS.'home'.DS.'user');
define('APP_DIR', 'app');
define('CAKE_CORE_INCLUDE_PATH', DS.'home'.DS.'user'.DS.'cake');
And that's about it.
MY PROBLEM IS THE FOLLOWING:
I have managed to deal with all the problems involved in the default index.php cakePHP page and I have a green and fully functional so to say, project. So when I access my "/", I get:
"Your tmp directory is writable.
The FileEngine is being used for caching. To change the config edit APP/config/core.php
Your database configuration file is present.
Cake is able to connect to the database."
Now, I've created a model-view-controller with a mysql database background (like in the 15 min Blog Tutorial ), but when I'm trying to access some views ( e.g. /posts )...it gives me a blank page ( this worked perfect on my local machine virtual server apache ).
What configuration am I missing ?
Thank you.
EDIT: Apparently I had problems with the hosting. My URL was something like:
http://gator111.hostgator.com/~username/
and all I had to do was add an extra line in the webroot .htaccess:
RewriteBase /~username/
Thanks for the support.
This tutorial is a life saver, I had the same problem that my host name comes with ~username. Now after adding the 'rewriteBase /~username/', works like a charm.
However, before all these, I followed a youtube tutorial by jason talking about how to configure cakephp on shared hosting. Just paste it here in case it helps anybody.
http://www.youtube.com/watch?v=4GobWo1rIkE&tracker=False

Resources