Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
a4dbb6fb
Commit
a4dbb6fb
authored
Oct 15, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Started shared hosting guide
parent
03d4a7f4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
1 deletion
+67
-1
README.md
docs/guide/README.md
+1
-1
tutorial-shared-hosting.md
docs/guide/tutorial-shared-hosting.md
+66
-0
No files found.
docs/guide/README.md
View file @
a4dbb6fb
...
...
@@ -169,7 +169,7 @@ Special Topics
*
[
Internationalization
](
tutorial-i18n.md
)
*
[
Mailing
](
tutorial-mailing.md
)
*
[
Performance Tuning
](
tutorial-performance-tuning.md
)
*
**TBD**
[
Shared Hosting Environment
](
tutorial-shared-hosting.md
)
*
[
Shared Hosting Environment
](
tutorial-shared-hosting.md
)
*
[
Template Engines
](
tutorial-template-engines.md
)
*
[
Working with Third-Party Code
](
tutorial-yii-integration.md
)
...
...
docs/guide/tutorial-shared-hosting.md
0 → 100644
View file @
a4dbb6fb
Shared Hosting Environment
==========================
Shared hosting environments are often quite limited about configuration and directory structure. Still in most cases
you can run Yii 2.0 on these.
Deploying basic application
---------------------------
Since there's typically only one webroot it is recommended to use basic application template. Refer to
[
Installing Yii chapter
](
start-installation.md
)
and install application template locally.
### Add extras for webserver
If webserver used is Apache you'll need to add
`.htacces`
file with the following content to
`web`
(where
`index.php`
is):
```
Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php
```
In case of nginx you should not need any extra config files.
### Renaming webroot
If after connecting to your shared hosting via FTP or by other means you're seeing something like the following, you're
most probably lucky.
```
config/
logs/
www/
```
In the above
`www`
is webserver directory root (i.e. webroot). It could be named differently. Common names are:
`www`
,
`htdocs`
,
`public_html`
. Since we have webroot in our basic application template named
`web`
we need to rename it to
whatever hosting webroot is before uploading.
### FTP root directory is writeable
If you can write to the root level directory i.e. where
`config`
,
`logs`
and
`www`
are, just upload
`assets`
,
`commands`
etc. as is.
### Check requirements
In order to run Yii hosting should meet its requirements. The very minimum requirement is PHP 5.4. In order to check
the rest copy
`requirements.php`
from root directory into webroot directory and run it via browser using
`http://example.com/requirements.php`
URL. Don't forget to delete the file afterwards.
Deploying advanced application
------------------------------
Deploying advanced application to shared hosting is a bit trickier than doing it with basic application because it has
two webroots.
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment