Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Use PaaS service to host your web - with pagodabox
Search
LucienLee
December 04, 2013
Programming
95
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Use PaaS service to host your web - with pagodabox
Fundamental PHP & Web Development
LucienLee
December 04, 2013
Transcript
41 slides
Use PaaS service to host your web - with pagodabox
Fundamental PHP & Web Development ! lecturer : Lucien Lee 李柏緯 Lecture 10
! Cloud Computing
Cloud Computing
None
Paas •Provide API to deploy your service •You don’t set
up a really remote environment. • Just use platform and set configuration. •Pay on demand
None
None
Basic outline 1. Register With Pagoda Box 2. Create Your
Application 3. Set Up Git 4. Create Your SSH Key 5. Deploy Your Code 6. Set Your Domain
Sign up
Create new app
None
? Git
Git
Why version control •Reversibility •Concurrency •History
Example
Git for Windows
Set Up SSH Keys 1. cd ~/.ssh 2. ssh-keygen -t
rsa -C "
[email protected]
" 3. cat ~/.ssh/id_rsa.pub 4. copy and paste
Paste to Pagoda Box Account Settings
There is a GUI method
There is a GUI method
There is a GUI method
There is a GUI method
Some commands your need
git init initial to use git
git remote add pagoda <remote address> SET REMOTE ADDRESS!
git push pagoda master DEPLOY!
Set environment configuring your app for Pagoda Box
BoxFile web1: name: albumapp shared_writable_dirs: [photo, thumbnail] php_date_timezone: Asia/Taipei php_extensions:
[mysql, gd] php_file_uploads: "1" db1: name: albumdb type: mysql
? How to connect DB
Environment variables $link = mysql_connect( $_SERVER['DB1_HOST'], $_SERVER['DB1_USER'], $_SERVER[‘DB1_PASS'] );
Simple Case create Table in php file
Copy sql and query $sql_album = "CREATE TABLE IF NOT
EXISTS `Album` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `Name` varchar(128) NOT NULL, `Owner` varchar(32) NOT NULL, `Timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ;"; ! mysql_query($sql_album);
Copy sql and query $sql_photo = "CREATE TABLE IF NOT
EXISTS `Photo` ( `ID` int(11) NOT NULL AUTO_INCREMENT, `Name` varchar(128) NOT NULL, `Filename` varchar(64) NOT NULL, `Comment` text, `AlbumID` int(11) DEFAULT NULL, PRIMARY KEY (`ID`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=25 ;"; ! mysql_query($sql_photo);
Copy sql and query $sql_user ="CREATE TABLE IF NOT EXISTS
`User` ( `Account` varchar(32) NOT NULL, `Password` varchar(32) NOT NULL, `Name` varchar(32) NOT NULL, PRIMARY KEY (`Account`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"; ! mysql_query($sql_user);
HOW TO MANAGE DB •You can use phpmyadmin too •Connect
DB by tunnel.
… Go further, learn more
Security issue how to defense with cracker attack?
Use PDO to link DB Better way to connect DB
Try some Framework cakePHP, condeignIter, ZEND, YII…
Login with other sites Facebook, google, twitter…
Thank you guys!
More Decks by LucienLee
See All by LucienLee
SASS & Compass 101
lucienlee
1
320
final album
lucienlee
0
83
Simple Album
lucienlee
0
110
Accessing MySQL from PHP
lucienlee
1
390
DataBase and MySQL
lucienlee
1
240
PHP 101+1:function & form
lucienlee
1
300
PHP 101: flow control
lucienlee
0
350
Start to Build your Web
lucienlee
1
460
既然如此,那我們來hack資本世界吧!
lucienlee
0
190
Other Decks in Programming
See All in Programming
Compiling Your Language to WasmGC & Friends
tanishiking
0
860
React Native経験者が Flutterを30⽇間触って驚いたこと
3saito
0
210
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
450
TS 7.0 で baseUrl が使えなくなった今、パスエイリアスをどうするか
bicstone
2
870
なぜ私たちは「現時点では」KMPの導入を見送ったのか
chigichan24
1
650
Canvas 2D Context Next
petamoriken
0
830
動画プレイヤーはなぜカクつくのか 〜Flutterのレンダリングとネイティブの境界を解剖する〜
naruogram
0
350
Kotlin JVM用に作られたライブラリのKMPを前提とした再設計
jsoizo
0
240
AppFunctionsの内部実装を紐解く
hiroaki404
1
130
数行の変更でDockerビルドを最大91%高速化~GitLab CIの実行基盤を社内40リポジトリに展開するまで~
picopico
3
1.2k
Math.sumPreciseから学ぶ、ECMAScript仕様の数値の種類
syumai
0
1.4k
はじめてのKubernetesコントリビューション
nasa9084
0
330
Featured
See All Featured
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1.1k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
250
1.3M
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
WCS-LA-2024
lcolladotor
0
1k
Discover your Explorer Soul
emna__ayadi
2
1.4k
The Pragmatic Product Professional
lauravandoore
37
7.5k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
680
Design in an AI World
tapps
1
400
Utilizing Notion as your number one productivity tool
mfonobong
4
710
sira's awesome portfolio website redesign presentation
elsirapls
0
530
Statistics for Hackers
jakevdp
799
230k