I wish to use a PHP Framework such as Yii, however, it seems to set this up I need access to a terminal or console. Unfortunately my only access to the server is via an FTP client as it's shared hosting.
Does this rule Yii out as a framework?
all you need to do is
1 - have a copy of yii framework folder
2 - generate a new yiic webapp folder
3 - upload both folders, the framework folder can go to some hidden place yoursite.com/wawa/framework/yii, and you can just upload the files in your webapp folder to yoursite.com/
4 - edit the index.php in your generated web app, so it know where your framework/yii folder is. than you are set
5 - just make different copy of your webapp folder, so you don't need to generate them if you dont want to. just use different names, wont make a difference, as long as the webapp index.php knows where your framework folder is, than it will work
According to this post you can generated all files on your computer and then just upload the files to your shared hosting.
You only need a terminal for developing on your local server (it isn't a good idea to develop directly on a shared server). To use it on a shared server just upload it.
In the strict sense you don't need a terminal. You could write your files yourself. The yiic program only creates a couple of php files.
I am first in Yii. Installed the application locally. FTP-ing the application to the share server in directory /home/sloki/user/h11741/sites/example.com/www then create abcd directory within /www and put framework into it.
Edit your index.php line 4 to be: $yii=dirname(FILE).'/abcd/framework/yii.php';
You will get error message like this
Application runtime path "/home/sloki/user/h11741/sites/example.com/www/protected/runtime" is not valid. Please make sure it is a directory writable by the Web server process.
Change permission of directories /protected/runtime and /assets to 777. Test the web, when success change again permission both directories to 775.
Gut lak.
Related
I am new to web development and cPanel. Now I am developing a website which has a medium scale database and a configuration php file. I am using small business web hosting plan with cPanal and phpMyAdmin included. Currently I am developing my site using WAMP server installed in my own home PC. So my question is this.
When I am searching more information about my project, I saw that someone has mentioned;
DO NOT PLACE DATABASE AND CONFIGURATION FILES ON LIVE & PUBLIC FOLDER. PLACE THEM ON DIFFERENT DIRECTORY OR USE HASH BECAUSE THEY STORES DB USER NAMES AND PASSWORDS..!
So, I don't know what is a "Hash" all about and all I want is to place my database and configuration files more securely.
Therefore, please tell me where to place my database files and other important files on cPanel and how I write paths between database and PHP files on different locations..? ex: www.abc.com/db/...
On the cPanel File Manager, the home directory, the directory you're in is the one above the public_html or www. Place your private stuff such as passwords and whatnot in directories there. DO NOT place them inside of public_html or www as this gives the public access to those files.
You can find phpmyadmin in cpanel for databases
I'm in the process of getting a Laravel 5 app working on Azure Web Apps and am encountering an issue via Laravel's temporary storage.
Any time a template renders, Laravel attempts to cache it to the local filesystem. Unfortunately, for some reason Laravel doesn't have permission to write to its storage directory.
I am deploying my application from my build server via FTP
I am running on the free-tier shared infrastructure (just while I'm getting set up)
My deployment server is running Linux
In this circumstance, it's obvious what the problem is. Unfortunately, what I don't understand is why my web server doesn't have access to write to the directories my FTP user uploads.
Ideally any solution offered will be one that I can automate as part of my deploy process.
According to http://clivern.com/working-with-laravel-caching/, you can change the directory of the cache files using the cache.php configuration file. I'd like to suggest you to use $_SERVER['DOCUMENT_ROOT'] to obtain the root folder of your web app, and then construct a path for the cache files.
I created a database project using PHPRunner to show data from a MySQL table in GridView. This project is saved in 'C:\xampp\htdocs\Project1\output'. When we run PHPRunner, this project runs on a XAMPP server in preview mode, but when we close the PHPRunner application, the project stops running in the XAMPP server.
How can we use this project code on my another website, so that the project can stay running? How would we use/embed this project into the site?
PHPrunner uses inbuilt server to preview your generated application. So quite obvious when you close Runner it will close the inbuilt server connection as well. You will have to move the output folder to root folder of your web server. If you look inside your project folder, you will find a folder named output, move this folder to the root folder of your web server, it should work fine.
Make sure your web server is powered to use PHP and other drivers related to your project.
If this is what you have
C:\xampp\htdocs\Project1\output
Then, copy the C:\xampp\htdocs\Project1**output** output folder to httdocs so it's like C:\xampp\htdocs\output it should work fine.
Check the url: it should be something like: http://localhost/project1/output. This when u run it with xamp. But when u open phptunner then it's server run it with different address
I have 106 PHP files present in folder. This folder is included (copied the folder in application folder) in all the web-application, which I have develop but the problem is, if I implement any change in code than I have to replicate that change in all the applications.
Is there any way through which I can share this folder in all web-application or domains which are hosted on same server?
I have tried using outside htdocs folder but things does not worked as I thought.
Kindly Guide.
Yes you can (assumed you have an linux server), if your domains are stored within the same server you can place your php files outside the html of one of them and then use something like this
include ("/home/user/domain/folder/file.php");
to include your php into another one
example
mydomainhost.com has the folder php with the 106 files
in your testdomain.com you include
include ("/home/user/mydomainhost.com/php/file.php");
user = your webserver account name
hope this helps you
i am using Symfony 1.4, to create my project. i have tried to deploy project using the command and methods given in chapter-16 in symfony book. but i am not able to deploy my symfony project from my local computer to web server. Can i directly copy paste my symfony project to my web server?? will that work?? or is there any other method??
NOTE: i am using Propel as ORM.
Your best option is:
1. gzip up the entire project
2. export all the data from the database using something like mysqldump
3. upload the files to the server
4. import the database dump into your server database
5. unzip your project
A couple notes:
1. Due to the shared hosting environment, you may have security issues due to other hosts on the server gaining access to your php files See here.
2. Hopefully your host allows SSH access to your server account, administering a symfony project is MUCH easier when this is the case.
3. If you don't have SSH access to your account you will have to upload the files to the server without gzipping them and this takes a LONG time due to the number of files symfony creates.
4. If possible place all your symfony files except for the web folder outside the public_html folder.
When I have to deploy something I do this:
Check if the requirement (php5, mysql4 etc) on the production server matches my application.
Change the configuration files to reflect the production server.
Upload everything to the server using ftp.
Your question is cryptic, you should really specify what kind of error you are getting.