Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Use PaaS service to host your web - with pagodabox
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
LucienLee
December 04, 2013
Programming
83
0
Share
Use PaaS service to host your web - with pagodabox
Fundamental PHP & Web Development
LucienLee
December 04, 2013
More Decks by LucienLee
See All by LucienLee
SASS & Compass 101
lucienlee
1
300
final album
lucienlee
0
74
Simple Album
lucienlee
0
96
Accessing MySQL from PHP
lucienlee
1
370
DataBase and MySQL
lucienlee
1
230
PHP 101+1:function & form
lucienlee
1
290
PHP 101: flow control
lucienlee
0
330
Start to Build your Web
lucienlee
1
430
既然如此,那我們來hack資本世界吧!
lucienlee
0
160
Other Decks in Programming
See All in Programming
コードレビューをしない選択 #でぃーぷらすトウキョウ
kajitack
3
1.3k
へんな働き方
yusukebe
6
2.9k
「接続」—パフォーマンスチューニングの最後の一手 〜点と点を結ぶ、その一瞬のために〜
kentaroutakeda
5
2.4k
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
0
290
Claude Codeログ基盤の構築
giginet
PRO
7
3.8k
それはエンジニアリングの糧である:AI開発のためにAIのOSSを開発する現場より / It serves as fuel for engineering: insights from the field of developing open-source AI for AI development.
nrslib
1
820
Reactive ❤️ Loom: A Forbidden Love Story
franz1981
2
210
Symfonyの特性(設計思想)を手軽に活かす特性(trait)
ickx
0
110
一度始めたらやめられない開発効率向上術 / Findy あなたのdotfilesを教えて!
k0kubun
3
2.7k
GC言語のWasm化とComponent Modelサポートの実践と課題 - Scalaの場合
tanishiking
0
140
Symfony + NelmioApiDocBundle を使った スキーマ駆動開発 / Schema Driven Development with NelmioApiDocBundle
okashoi
0
250
Geminiをパートナーに神社DXシステムを個人開発した話(いなめぐDX 開発振り返り)
fujiba
0
130
Featured
See All Featured
Information Architects: The Missing Link in Design Systems
soysaucechin
0
860
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.9k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
140
Agile that works and the tools we love
rasmusluckow
331
21k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.2k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
140
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
160
Technical Leadership for Architectural Decision Making
baasie
3
300
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
160
Transcript
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!