Author: Charles
-
php 서버 설치 후 확인
php 서버 설치 후 확인short_open_tag = On“<?php” 와 “<?” 를 사용 할 수 있도록 한다.display_errors = OnPHP 스크립트 실행시 에러 발생시 해당 메세지를 출력한다.(off 인 경우에는 HTTP 500 내부 서버 오류 출력)date.timezone = Asia/Seoul해당 타임존을 설정한다.error_reporting=E_ALL & ~E_NOTICE & ~E_DEPRECATEDnotice 에러는 무시한다. -
Apple 소프트웨어 제품에서 사용하는 TCP 및 UDP 포트
Apple 소프트웨어 제품에서 사용하는 TCP 및 UDP 포트
OS X, OS X Server, Apple Remote Desktop 및 iCloud와 같은 Apple 제품에서 사용하는 TCP 및 UDP에 대해 자세히 알아봅니다. 이 중 대다수가 ‘잘 알려진’ 업계 표준 포트입니다.
Apple 제품에서 사용하는 포트
아래 표에는 Apple 제품에서 사용하는 TCP 및 UDP 포트가 간략히 나와 있습니다. 이 정보는 네트워크 관리자가 컴퓨터 또는 장비에서 자동 소프트웨어 업데이트와 같은 서비스 또는 App Store에 연결할 수 있는지 확인하는 데 필요할 수 있습니다. TCP 또는 UDP 포트가 무엇인지 알아보려면 ‘OS X: 포트란 무엇입니까?‘의 ‘IP 포트’ 섹션을 참조하십시오.
표에 나열된 포트 및 서비스를 모든 소프트웨어 제품에서 사용하는 것은 아닙니다. 일부 App은 하나 이상의 포트가 필요합니다. 네트워크 관리자는 방화벽 또는 이와 유사한 접근 제어 시스템 설정 방법을 결정할 때 이 문서의 정보 외에도 포트 감시 소프트웨어를 사용하고자 할 수도 있습니다. Mac OS X v10.5 또는 이후 버전에는 포트 기반 방화벽과는 다른 응용 프로그램 방화벽이 포함되어 있는 점에 유의하십시오.
이 문서는 정기적으로 업데이트되며, 발행 당시에 적용되는 정보를 포함합니다. 이 문서는 빠른 참조용일 뿐, 종합적인 정보를 제공하지는 않습니다. 표에 나열된 Apple 제품은 가장 많이 사용하는 제품을 예로 든 것으로, 전체 목록은 아닙니다.

서비스 또는 프로토콜 이름 열에는 인터넷 할당 번호 관리 기관에 등록된 서비스가 나열되어 있습니다. 단, ‘등록되지 않은 사용’으로 표시된 경우는 예외입니다. 이러한 서비스 또는 프로토콜을 사용하는 Apple 제품의 이름은 사용 제품/추가 정보 열에 표시되어 있습니다.RFC 열에는 특정 서비스 또는 프로토콜을 정의하는 설명 요청 문서 번호가 나열되어 있는데 이러한 번호는 참조용으로 사용할 수 있습니다. RFC 문서는 RFC Editor(RFC 편집자)에서 유지 관리합니다. 여러 RFC에서 정의하는 프로토콜이 하나라면 이 열에도 하나만 나열되어 있을 수 있습니다. 일부 서비스에는 둘 이상의 포트를 사용할 수 있습니다. 이 목록에서 제품 사례를 발견한 경우 해당 이름을 검색(command-F)한 다음 검색을 반복(command-G)하여 모든 제품 사례를 찾습니다. 예를 들어 VPN 서비스는 서로 다른 포트를 최대 4개(예: 500, 1701, 1723, 4500)까지 사용할 수 있습니다.
방화벽에 따라 번호가 같은 UDP 포트 또는 TCP 포트 중에서 선택하여 구성할 수도 있으므로 어떤 유형의 포트를 구성 중인지 확인하는 것이 중요합니다. 예를 들어 NFS에서는 TCP 2049 및 UDP 2049 포트를 둘 다 또는 둘 중 하나만 사용할 수 있습니다. 방화벽에서 사용자가 항목을 지정하도록 허용하지 않는 경우 포트 하나를 변경하면 변경 사항이 다른 포트에도 적용될 것입니다.
터미널 명령의 출력은 /etc/services에 나열되어 있는 레이블로 포트 번호를 대체할 수도 있습니다. 연결된 레이블이 무엇인지 확인하려면 표의 서비스 이름 열을 참조하십시오.
포트 TCP 또는 UDP 서비스 또는 프로토콜 이름 RFC 서비스 이름 사용 제품/추가 정보 7 TCP/UDP echo 792 echo – 20 TCP FTP(File Transport Protocol) 959 ftp-data – 21 TCP FTP 제어 959 ftp – 22 TCP SSH(보안 셸) 4253 ssh Xcode Server(호스팅되는 원격 Git+SSH, 원격 SVN+SSH) 23 TCP Telnet 854 telnet – 25 TCP SMTP(Simple Mail Transfer Protocol) 5321 smtp Mail(이메일 송신용), iCloud Mail(송신) 53 TCP/UDP DNS(Domain Name System) 1034 domain MacDNS, FaceTime 67 UDP BootP, bootps(Bootstrap Protocol Server) 951 bootps DHCP를 통한 NetBoot 68 UDP bootpc(Bootstrap Protocol Client) 951 bootpc DHCP를 통한 NetBoot 69 UDP TFTP(Trivial File Transfer Protocol) 1350 tftp – 79 TCP Finger 1288 finger – 80 TCP HTTP(Hypertext Transfer Protocol) 2616 http World Wide Web, iCloud, QuickTime 설치 프로그램, 지도, iTunes U, Apple Music, iTunes Store, Podcast, 인터넷 라디오, OS X 소프트웨어 업데이트(OS X Lion 및 이전 버전), Mac App Store, RAID 관리자, 백업, 캘린더, WebDAV, Final Cut Server, AirPlay, OS X 인터넷 복구, 프로파일 관리, Xcode Server(Xcode App, 호스팅되는 원격 Git HTTP, 원격 SVN HTTP). 88 TCP Kerberos 4120 kerberos Kerberos(화면 공유 인증 포함) 106 TCP 암호 서버
(등록되지 않은 사용)– 3com-tsmux Mac OS X Server 암호 서버 110 TCP POP3(Post Office Protocol)
APOP(Authentication Post Office Protocol)1939 pop3 Mail(이메일 수신용) 111 TCP/UDP RPC(Remote Procedure Call) 1057, 1831 sunrpc Portmap(sunrpc) 113 TCP 식별 프로토콜 1413 ident – 115 TCP SFTP(Simple File Transfer Protocol) 913 sftp – 119 TCP NNTP(Network News Transfer Protocol) 3977 nntp 뉴스 그룹을 읽는 응용 프로그램에서 사용합니다. 123 UDP NTP(Network Time Protocol) 1305 ntp 날짜와 시간 환경설정. 네트워크 시간 서버 동기화, 즉 AppleTV 네트워크 시간 서버 동기화에서 사용합니다. 137 UDP WINS(Windows Internet Naming Service) – netbios-ns – 138 UDP NETBIOS Datagram Service – netbios-dgm Windows Datagram Service, Windows Network Neighborhood 139 TCP SMB(Server Message Block) – netbios-ssn Mac OS X에서의 Windows 공유와 같은 Microsoft Windows 파일 및 프린트 서비스에서 사용합니다. 143 TCP IMAP(Internet Message Access Protocol) 3501 imap Mail(이메일 수신용) 161 UDP SNMP(Simple Network Management Protocol) 1157 snmp – 192 UDP OSU 네트워크 모니터링 시스템 – osu-nms AirPort 베이스 스테이션 PPP 상태 또는 인식(특정 구성), AirPort 관리 유틸리티, AirPort Express 지원 311 TCP 보안 서버 관리 – asip-webadmin Server app, Server Admin, 작업 그룹 관리자, Server Monitor, Xsan Admin. 312 TCP Xsan 관리 – vslmp Xsan 관리(OS X Mountain Lion 10.8 및 이후 버전) 389 TCP LDAP(Lightweight Directory Access Protocol) 4511 ldap Mail 및 주소록과 같이 주소를 찾는 응용 프로그램에서 사용합니다. 427 TCP/UDP SLP(Service Location Protocol) 2608 svrloc 네트워크 브라우저 443 TCP SSL(Secure Sockets Layer), 즉 ‘HTTPS’ 2818 https TLS 웹 사이트, iTunes Store, OS X 소프트웨어 업데이트(Mountain Lion 및 이후 버전), Spotlight 제안, Mac App Store, 지도, FaceTime, Game Center, iCloud 인증 및 DAV 서비스(연락처, 캘린더 및 책갈피), iCloud 백업 및 응용 프로그램(캘린더, 연락처, 나의 iPhone 찾기/나의 친구 찾기, Mail, 문서 및 사진 스트림), iCloud KVS(Key Value Store), iPhoto 저널, AirPlay, OS X 인터넷 복구, 프로파일 관리, 나의 Mac으로 돌아가기, 받아쓰기, Siri(iOS), Xcode Server(호스팅되는 원격 Git HTTPS, 원격 SVN HTTPS, Apple Developer 등록). 445 TCP Microsoft SMB Domain Server – microsoft-ds – 464 TCP/UDP kpasswd 3244 kpasswd – 465 TCP Mail에서 메시지 제출(인증된 SMTP) SMTP(기존) Mail(메일 전송용) 500 UDP ISAKMP/IKE 2408 isakmp OS X Server VPN 서비스, 나의 Mac으로 돌아가기 500 UDP Wi-Fi 통화 5996 IKEv2 Wi-Fi 통화 514 TCP shell – shell – 514 UDP Syslog – syslog – 515 TCP LPR(Line Printer), LPD(Line Printer Daemon) – 프린터 네트워크 프린터로 프린트, Mac OS X에서의 프린터 공유에서 사용합니다. 532 TCP netnews – netnews – 548 TCP TCP를 통한 AFP(Apple Filing Protocol) – afpovertcp AppleShare, 개인 파일 공유, Apple 파일 서비스 554 TCP/UDP RTSP(Real Time Streaming Protocol) 2326 rtsp QTSS(QuickTime Streaming Server), 스트리밍 미디어 플레이어, AirPlay 587 TCP Mail에서 메시지 제출(인증된 SMTP) 4409 submission Mail(메일 송신용), iCloud Mail(SMTP 인증) 600~1023 TCP/UDP Mac OS X RPC 기반 서비스 – ipcserver NetInfo 등에서 사용합니다. 623 UDP Lights-Out-Monitoring – asf-rmcp Intel Xserve의 LOM(Lights-Out-Monitoring) 기능에서 사용합니다. 서버 모니터에서 사용합니다. 625 TCP ODProxy(Open Directory Proxy)(등록되지 않은 사용) – dec_dlm Open Directory, Server App, 작업 그룹 관리자, OS X Lion 및 이전 버전의 디렉토리 서비스. 참고: 이 포트는 DEC DLM에 등록되어 있습니다. 626 TCP ASIA(AppleShare Imap Admin) – asia IMAP 관리(Mac OS X Server 10.2.8 또는 이전 버전) 626 UDP 일련 번호 지정됨(등록되지 않은 사용) – asia 서버 일련 번호 등록(Xsan, Mac OS X Server v10.3~v10.6) 631 TCP IPP(Internet Printing Protocol) 2910 ipp Mac OS X 프린터 공유, 대다수의 일반 프린터로 프린트 636 TCP 보안 LDAP – ldaps – 660 TCP 서버 관리 – mac-srvr-admin AppleShare IP를 비롯한 Mac OS X Server 10.4 및 이전 버전용 서버 관리 도구입니다. 687 TCP 서버 관리 – asipregistry AppleShare IP를 비롯한 Mac OS X Server 10.6 및 이전 버전용 서버 관리 도구입니다. 749 TCP/UDP Kerberos 5 admin/changepw – kerberos-adm – 985 TCP NetInfo 정적 포트 – – – 993 TCP Mail IMAP SSL – imaps iCloud Mail(SSL IMAP) 995 TCP/UDP Mail POP SSL – pop3s – 1085 TCP/UDP WebObjects – webobjects – 1099 및 8043 TCP JBOSS에 대한 원격 RMI 및 IIOP 접근 – rmiregistry – 1220 TCP QT Server Admin – qt-serveradmin QuickTime Streaming Server 관리에 사용합니다. 1640 TCP Certificate Enrollment Server – cert-responder 프로파일 관리자, SCEP 1649 TCP IP 장애 조치 – kermit – 1701 UDP L2TP – l2f Mac OS X Server VPN 서비스 1723 TCP PPTP – pptp Mac OS X Server VPN 서비스 1900 UDP SSDP – ssdp Bonjour, 나의 Mac으로 돌아가기 2049 TCP/UDP NFS(Network File System)(버전 3 및 버전 4) 3530 nfsd – 2195 TCP APNS(Apple 푸시 알림 서비스) – – 푸시 알림 2196 TCP APNS(Apple 푸시 알림 서비스) – – 피드백 서비스 2336 TCP 모바일 계정 동기화 – appleugcontrol 홈 디렉토리 동기화 3004 TCP iSync – csoftragent – 3031 TCP/UDP 원격 Apple 이벤트 – eppc 프로그램 연결, 원격 Apple 이벤트 3283 TCP/UDP Net Assistant – net-assistant Apple Remote Desktop 2.0 또는 이후 버전(보고 기능) 3306 TCP MySQL – mysql – 3478~3497 UDP – – nat-stun-port – ipether232port FaceTime, Game Center 3632 TCP 분산 컴파일러 – distcc – 3659 TCP/UDP SASL(Simple Authentication and Security Layer) – apple-sasl Mac OS X Server 암호 서버 3689 TCP DAAP(Digital Audio Access Protocol) – daap iTunes 음악 공유, AirPlay 3690 TCP/UDP Subversion – svn Xcode Server(익명 원격 SVN) 4111 TCP XGrid – xgrid – 4398 UDP – – – Game Center 4488 TCP Apple 광역 연결 서비스 awacs-ice 나의 Mac으로 돌아가기 4500 UDP IPsec NAT 통과 4306 ipsec-msft OS X Server VPN 서비스, 나의 Mac으로 돌아가기. 참고: AirPort 베이스 스테이션에 나의 Mac으로 돌아가기를 구성하거나 NAT 모드로 Time Capsule을 구성하면 NAT로 구성된 OS X Server VPN 서비스에 대한 연결이 지연됩니다. 4500 UDP Wi-Fi 통화 5996 IKEv2 Wi-Fi 통화 5003 TCP FileMaker – 이름 바인딩 및 전송 – fmpro-internal – 5009 TCP (등록되지 않은 사용) – winfs AirPort 유틸리티, AirPort Express Assistant 5060 UDP SIP(Session Initiation Protocol) 3261 sip iChat 5100 TCP – – socalia Mac OS X 카메라 및 스캐너 공유 5190 TCP/UDP AOL(America Online) – aol iChat 및 AOL 인스턴트 메신저, 파일 전송 5222 TCP XMPP(Jabber) 3920 jabber-client iChat 및 Jabber 메시지 5223 TCP Apple 푸시 알림 서비스 – – iCloud DAV 서비스(연락처, 캘린더 및 책갈피), APNS, FaceTime, Game Center, 사진 스트림, 나의 Mac으로 돌아가기 5269 TCP XMPP 서버 간 통신 3920 jabber-server iChat 서버 5297 TCP – – – iChat(로컬 트래픽) 5298 TCP/UDP – – – iChat(로컬 트래픽) 5350 UDP NAT 포트 매핑 프로토콜 알림 – – Bonjour, 나의 Mac으로 돌아가기 5351 UDP NAT 포트 매핑 프로토콜 – nat-pmp Bonjour, 나의 Mac으로 돌아가기 5353 UDP MDNS(Multicast DNS) 3927 mdns Bonjour, AirPlay, 홈 공유, 프린터 검색, 나의 Mac으로 돌아가기 5432 TCP PostgreSQL – postgresql Lion Server에서 수동으로 활성화할 수 있습니다. 이전에는 ARD 2.0 데이터베이스에 대해 기본적으로 활성화되어 있었습니다. 5678 UDP SNATMAP 서버 – rrac 5678번 포트의 SNATMAP 서비스는 NAT(Network Address Translation)를 통한 iChat 사용자 간 연결이 제대로 작동할 수 있도록 호스트의 외부 인터넷 주소를 확인하는 데 사용됩니다. SNATMAP 서비스는 연결하는 인터넷 주소를 클라이언트에 단순히 알려 줍니다. 이 서비스는 Apple 서버에서 실행되지만 Apple로 개인 정보를 보내지는 않습니다. 특정 iChat AV 기능을 사용할 때 이 서비스에 접속됩니다. 이 서비스를 차단하면 NAT를 사용하는 네트워크의 호스트와 iChat AV를 연결하는 데 문제가 발생할 수 있습니다. 5897~5898 UDP (등록되지 않은 사용) – – xrdiags 5900 TCP VNC(Virtual Network Computing)
(등록되지 않은 사용)– vnc-server Apple Remote Desktop 2.0 또는 이후 버전(감시/제어 기능)
화면 공유(Mac OS X 10.5 또는 이후 버전)5988 TCP WBEM HTTP – wbem-http Apple Remote Desktop 2.x(http://dmtf.org/standards/wbem참조) 6970~9999 UDP – – – QuickTime Streaming Server 7070 TCP RTSP(등록되지 않은 사용)
ARCP(Automatic Router Configuration Protocol – 등록된 사용)– arcp QuickTime Streaming Server(RTSP) 7070 UDP RTSP 대체 – arcp QuickTime Streaming Server 7777 TCP iChat 서버 파일 전송 프록시(등록되지 않은 사용) – cbt – 8000~8999 TCP – – irdmi 웹 서비스, iTunes Radio 스트림 8005 TCP Tomcat 원격 종료 – – – 8008 TCP iCal 서비스 – http-alt Mac OS X Server 10.5 및 이후 버전 8080 TCP Apache 웹 서비스용 대체 포트 – http-alt Mac OS X Server 10.4 및 이전 버전의 JBOSS HTTP도 해당 8085~8087 TCP Wiki 서비스 – – Mac OS X Server 10.5 및 이후 버전 8088 TCP 소프트웨어 업데이트 서비스 – radan-http Mac OS X Server v10.4 및 이후 버전 8089 TCP 웹 이메일 규칙 – – Mac OS X Server 10.6 및 이후 버전 8096 TCP 웹 암호 재설정 – – Mac OS X Server 10.6.3 및 이후 버전 8170 TCP HTTPS(웹 서비스/사이트) – – Podcast Capture/Podcast CLI 8171 TCP HTTP(웹 서비스/사이트) – – Podcast Capture/Podcast CLI 8175 TCP Pcast 터널 – – pcastagentd(제어 작업, 카메라 등) 8443 TCP iCal 서비스(SSL) – pcsync-https Mac OS X Server 10.5 및 이후 버전. Mac OS X Server 10.4 및 이전 버전에서는 JBOSS HTTPS였음. 8800 TCP 주소록 서비스 – sunwebadmin Mac OS X Server 10.6 및 이후 버전 8843 TCP 주소록 서비스(SSL) – – Mac OS X Server 10.6 및 이후 버전 8821, 8826
TCP 저장됨 – – Final Cut Server 8891 TCP ldsd – – Final Cut Server(데이터 전송) 9006 TCP Tomcat 독립형 – – Mac OS X Server 10.6 및 이전 버전 9100 TCP 프린트 – – 특정 네트워크 프린터로 프린트하는 데 사용합니다. 9418 TCP/UDP Git 팩 전송 – git Xcode Server(원격 Git) 10548 TCP Apple 문서 공유 서비스 – serverdocs OS X Server iOS 파일 공유 11211 – memcached(등록되지 않음) – – 캘린더 서버 16080 TCP – – – 성능 캐시가 있는 웹 서비스 16384~16403 UDP RTP(Real-Time Transport Protocol), RTCP(Real-Time Control Protocol) – connected, – iChat AV(오디오 RTP, RTCP, 비디오 RTP, RTCP) 16384~16387 UDP RTP(Real-Time Transport Protocol), RTCP(Real-Time Control Protocol) – connected, – FaceTime, Game Center 16393~16402 UDP RTP(Real-Time Transport Protocol), RTCP(Real-Time Control Protocol) – – FaceTime, Game Center 16403~16472 UDP RTP(Real-Time Transport Protocol), RTCP(Real-Time Control Protocol) – – Game Center 24000~24999 TCP – – med-ltp 성능 캐시가 있는 웹 서비스 42000~42999 TCP – – – iTunes Radio 스트림 49152~65535 TCP Xsan – – Xsan Filesystem 접근 49152~65535 UDP – – – 나의 Mac으로 돌아가기 50003 – FileMaker 서버 서비스 – – – 50006 – FileMaker 보조 서비스 – – – Apple이 제조하지 않은 제품에 관한 정보 또는 Apple의 관리 또는 테스트 대상이 아닌 독립적인 웹 사이트는 권장 또는 보증 없이 제공되는 것입니다. Apple은 타사 웹 사이트 또는 제품에 대한 선택, 성능, 사용과 관련하여 발생하는 결과에 대해 책임을 지지 않습니다. Apple은 타사 웹 사이트의 정확성 또는 신뢰도에 대해 어떠한 언급도 하지 않습니다. 인터넷을 사용하는 데는 위험이 따르기 마련입니다. 자세한 내용은 공급업체에 문의하십시오. 기타 회사 및 제품 이름은 각 소유자의 상표일 수 있습니다.
최근 수정일: -
How to Flush DNS Cache in Mac OS X
Whether you’re a systems administrator or a web developer, or anything in between, chances are you’ll have to flush your DNS cache every once in a while to get things straightened out server-side, or even just for testing certain configurations.
Flushing your DNS cache in Mac OS X is actually really easy, but there are actually several different commands to use, and you will find the commands are unique to different versions of OS X. We’ve got you covered regardless of what version of Mac OS X you’re running, from OS X 10.10, OS X 10.9, all the way back to 10.4. So find your version of OS X, open your Terminal, and follow the appropriate directions below to get started.
Remember, each of these commands must be entered into the command line, by way of the Terminal applications (found in /Applications/Utilities/ in all version of Mac OS X). Launch that app first and then you can just copy and paste the commands in if you’d like.Clearing DNS Cache in OS X 10.10 Yosemite
Running the latest version of OS X? Clearing DNS caches in OS X Yosemite has changed again, split into MDNS and UDNS or combined like we’ll use below, here’s the command that is needed:
sudo discoveryutil mdnsflushcache;sudo discoveryutil udnsflushcaches;say flushedYou can read much more about resetting and flushing DNS cache in OS X Yosemite here if you’re interested.
Flush DNS in OS X 10.9 Mavericks
Rere is how to flush the DNS cache in 10.9:
dscacheutil -flushcache;sudo killall -HUP mDNSResponderYou will need to enter the admin password for this task to complete. If you notice, it combines killing mDNSResponder with the standard dscacheutil, making it a two step process to first, flush cache, then reload the DNS handling in OS X so that the changes take effect.
Flushing DNS Cache in OS X Lion (10.7) and OS X Mountain Lion (10.8)
Launch Terminal and enter the following command, you will need to enter an administrative password:
sudo killall -HUP mDNSResponder
Note the dscacheutil still exists in 10.7 and 10.8, but the official method to clear out DNS caches is through killing mDNSResponder. You can also find that process running in Activity Monitor.One helpful trick if you find yourself flushing the DNS frequently is to setup an alias for that command string in your .bash_profile or in the profile of your shell of choice. A simple bash alias for flushing cache could be this:
alias flushdns='dscacheutil -flushcache;sudo killall -HUP mDNSResponder'Save that into .bash_profile, then typing “flushdns” would prevent having to use the full command string in the future.
Flush DNS Cache in Mac OS X 10.5, Mac OS X 10.6
Launch Terminal and issue the following command:
dscacheutil -flushcache
All done, your DNS has been flushed. On a side note, the dscacheutil is interesting in general and worth taking a look at, try the -statistics flag instead for some stats.Flush DNS in Mac OS X 10.4 Tiger, & 10.3
Type the following command in the Terminal:
lookupd -flushcache
That’s it, that’s all there is to it. Now your DNS settings should be as you intended them to be, which you can easily verify with various networking tools like http, ping, nslookup, traceroute, curl, or whatever else is appropriate to your specific situation.If you find something isn’t working and DNS does not appear to have changed, verify the version of OS X you’re running and use the appropriate commands for the latest version. If you’re still having problems after that, try a different machine ideally on a different network (like a cell phone) to verify that it’s not an issue with the remote server.
-
asp <-> php 상호 변환
General syntax - ASP Comments, inline
'my dog has fleas
- PHP Comments, inline
//my dog has fleas
- ASP Comments, block
not available?
- PHP Comments, block
/*
The quick brown fox
jumped over the lazy dogs.
*/
- ASP, Escaping quotes
""“var text1=””<img src=\””blank.gif\””>””;”
- PHP, Escaping quotes
\" or use ' like javascript‘var text1=”<img src=\”blank.gif\”>”;’;
- ASP Command termination
None, but only one command per line.
- PHP Command termination
Each command must end with ; but
multiple commands per line are allowed.
- ASP Screen output
response.write "hello"
- PHP Screen output
echo "hello";
- ASP Newline characters
vbCrLfresponse.write “hello” & vbCrLf
- PHP Newline characters
"\n" (must be inside "", not '')echo “hello \n”;
- ASP Variable Names
Not case sensitive,
so fName is the same as FNAME
- PHP Variable Names
Case sensitive AND must begin with $
so $fName is NOT the same as $FNAME
String Functions - ASP String concatenation
&fname=name1 & ” ” & name2
emsg=emsg & “error!”
- PHP String concatenation
. and .=$fname=$name1.” “.$name2;
$emsg.=”error!”;
- ASP, Change case
LCase(), UCase()lowerName=LCase(chatName)
upperName=UCase(chatName)
- PHP, Change case
strtolower(), strtoupper()$lowerName=strtolower($chatName);
$upperName=strtoupper($chatName);
- ASP String length
Len()n=Len(chatName)
- PHP String length
strlen()$n=strlen($chatName);
- ASP, Trim whitespace
Trim()temp=Trim(xpage)
- PHP, Trim whitespace
trim() and also ltrim(), rtrim()$temp=trim($xpage);
- ASP String sections
-
Left(), Right(), Mid() Left("abcdef",3) result = "abc" Right("abcdef",2) result = "ef" Mid("abcdef",3) result = "cdef" Mid("abcdef",2,4) result = "bcde"
- PHP String sections
-
substr() substr("abcdef",0,3); result = "abc" substr("abcdef",-2); result = "ef" substr("abcdef",2); result = "cdef" substr("abcdef",1,4); result = "bcde"
- ASP String search forward, reverse
-
Instr(), InstrRev() x=Instr("abcdef","de") x=4 x=InstrRev("alabama","a") x=7
- PHP String search forward, reverse
-
strpos(), strrpos() $x=strpos("abcdef","de"); x=3 $x=strrpos("alabama","a"); x=6
- ASP String replace
Replace(string exp,search,replace)temp=Replace(temp,”orange”,”apple”)
temp=Replace(temp,”‘”,”\’”)
temp=Replace(temp,””””,”\”””)
- PHP String replace
str_replace(search,replace,string exp)$temp=str_replace(“orange”,”apple”,$temp); $temp=str_replace(“‘”,”\\’”,$temp);
$temp=str_replace(“\””,”\\\””,$temp);
- ASP, split a string into an array
-
Split() temp="cows,horses,chickens" farm=Split(temp,",",-1,1) x=farm(0)
- PHP, split a string into an array
-
explode() $temp="cows,horses,chickens"; $farm=explode(",",$temp); $x=$farm[0];
- ASP, convert ASCII to String
x=Chr(65) x="A"
- PHP, convert ASCII to String
$x=chr(65); x="A"
- ASP, convert String to ASCII
x=Asc("A") x=65
- PHP, convert String to ASCII
$x=ord("A") x=65
Control Structures - ASP, if statements
-
if x=100 then x=x+5 elseif x<200 then x=x+2 else x=x+1 end if
- PHP, if statements
-
if ($x==100) { $x=$x+5; } else if ($x<200) { $x=$x+2; } else { $x++; }
- ASP, for loops
-
for x=0 to 100 step 2 if x>p then exit for next
- PHP, for loops
-
for ($x=0; $x<=100; $x+=2) { if ($x>$p) {break;} }
- ASP, while loops
-
do while x<100 x=x+1 if x>p then exit do loop
- PHP, while loops
-
while ($x<100) { $x++; if ($x>$p) {break;} }
- ASP, branching
-
select case chartName case "TopSales" theTitle="Best Sellers" theClass="S" case "TopSingles" theTitle="Singles Chart" theClass="S" case "TopAlbums" theTitle="Album Chart" theClass="A" case else theTitle="Not Found" end select
- PHP, branching
-
switch ($chartName) { case "TopSales": $theTitle="Best Sellers"; $theClass="S"; break; case "TopSingles": $theTitle="Singles Chart"; $theClass="S"; break; case "TopAlbums": $theTitle="Album Chart"; $theClass="A"; break; default: $theTitle="Not Found"; }
- ASP functions
-
Function myFunction(x) myFunction = x*16 'Return value End Function
- PHP functions
-
function myFunction($x) { return $x*16; //Return value }
HTTP Environment - ASP, Server variables
-
Request.ServerVariables("SERVER_NAME") Request.ServerVariables("SCRIPT_NAME") Request.ServerVariables("HTTP_USER_AGENT") Request.ServerVariables("REMOTE_ADDR") Request.ServerVariables("HTTP_REFERER")
- PHP, Server variables
-
$_SERVER["HTTP_HOST"]; $_SERVER["PHP_SELF"]; $_SERVER["HTTP_USER_AGENT"]; $_SERVER["REMOTE_ADDR"]; @$_SERVER["HTTP_REFERER"]; @ = ignore errors
- ASP Page redirects
Response.redirect("wrong_link.htm")
- PHP Page redirects
header("Location: wrong_link.htm");
- ASP, GET and POST variables
Request.QueryString("chat")
Request.Form("username")
- PHP, GET and POST variables
@$_GET["chat"]; @ = ignore errors
@$_POST["username"];
- ASP, prevent page caching
Response.CacheControl="no-cache"
Response.AddHeader "pragma","no-cache"
- PHP, prevent page caching
header("Cache-Control: no-store, no-cache");
header("Pragma: no-cache");
- ASP, Limit script execution time, in seconds
Server.ScriptTimeout(240)
- PHP, Limit script execution time, in seconds
set_time_limit(240);
- ASP, Timing script execution
-
s_t=timer ...ASP script to be timed... duration=timer-s_t response.write duration &" seconds"
- PHP, Timing script execution
-
$s_t=microtime(); ...PHP script to be timed... $duration=microtime_diff($s_t,microtime()); $duration=sprintf("%0.3f",$duration); echo $duration." seconds"; //required function function microtime_diff($a,$b) { list($a_dec,$a_sec)=explode(" ",$a); list($b_dec,$b_sec)=explode(" ",$b); return $b_sec-$a_sec+$b_dec-$a_dec; }
File System Functions - ASP, create a file system object (second line is wrapped)
'Required for all file system functions
fileObj=Server.CreateObject
("Scripting.FileSystemObject")
- PHP, create a file system object
Not necessary in PHP
- ASP, check if a file exists
pFile="data.txt"
fileObj.FileExists(Server.MapPath(pFile))
- PHP, check if a file exists
$pFile="data.txt";
file_exists($pFile);
- ASP, Read a text file
-
pFile="data.txt" xPage=fileObj.GetFile(Server.MapPath(pFile)) xSize=xPage.Size 'Get size of file in bytes xPage=fileObj.OpenTextFile(Server.MapPath(pFile)) temp=xPage.Read(xSize) 'Read file linkPage.Close
- PHP, Read a text file
-
$pFile="data.txt"; $temp=file_get_contents($pFile); //Read file
Time and Date Functions - ASP, Server Time or Date
Now, Date, Time
- PHP, Server Time or Date
date()
- ASP, Date format (default)
Various ASP functions extract date parts:Month(Date) = 3Now = 3/19/2007 8:13:10 AM
Date = 3/19/2007
Time = 8:13:10 AM
MonthName(Month(Date)) = March
Day(Date) = 19
WeekdayName(Weekday(Date)) = Monday
WeekdayName(Weekday(Date),False) = Mon
- PHP, Date format
date(“n/j/Y g:i:s A”) = 3/19/2007 8:13:10 AMdate(“n”) = 3There is no default format in PHP.
The date() function is formatted using codes:
date(“F”) = March
date(“j”) = 19
date(“l”) = Monday
date(“D”) = Mon
Numeric Functions - ASP, convert decimal to integer
Int()n=Int(x)
- PHP, convert decimal to integer
floor()$n=floor($x);
- ASP, determine if a value is numeric
IsNumeric()if IsNumeric(n) then …
- PHP, determine if a value is numeric
is_numeric()if (is_numeric($num)) {…}
- ASP, modulus function
x mod y
- PHP, modulus function
$x % $
-
Microsoft IIS 7.0 and later with php 7
Microsoft IIS 7.0 and later with php 7http://php.net/manual/kr/install.windows.iis7.php#install.windows.iis7http://php.net/manual/kr/mysql.installation.phpmysqli vs PDO drivershttp://code.tutsplus.com/tutorials/pdo-vs-mysqli-which-should-you-use–net-24059php 한글 manualhttp://php.net/manual/kr/deprecated in php7 – php_mysql.dllhttps://wiki.php.net/rfc/remove_deprecated_functionality_in_php7mysqli_pagenation.phphttps://www.developphp.com/video/PHP/Pagination-MySQLi-Google-Style-Paged-Results-Tutorialhttp://www.9lessons.info/2010/10/pagination-with-jquery-php-ajax-and.htmlhttp://www.phpgang.com/how-to-create-advance-pagination-in-php-mysql-with-jquery_404.htmlPDO_pagenation.phphttp://www.phpro.org/tutorials/Pagination-with-PHP-and-PDO.htmlhttp://www.phpro.org/tutorials/Filtering-Data-with-PHP.html -
MySQL Workbench localhost connection errors
mysql localhost 접속 오류시
MySQL Workbench에서 localhost 접속시 can’t connect Mysql 5.* server on ‘127.0.0.1’ (10061) 접속 오류 해결 방법https://dukeom.wordpress.com/2011/08/12/mysql-workbench%EC%97%90%EC%84%9C-localhost-%EC%A0%91%EC%86%8D%EC%8B%9C-cant-connect-mysql-5-server-on-127-0-0-1-10061-%EC%A0%91%EC%86%8D-%EC%98%A4%EB%A5%98-%ED%95%B4%EA%B2%B0-%EB%B0%A9/ -
SQL injection and eliminate script from table column and reduce transaction log
SQL 인젝션 공격을 당했을 경우 인젝션 스크립트 지우는 저장 프로시저
http://m.blog.naver.com/khihome/40114387404SQL Server 트랜잭션 로그 줄이기http://m.blog.naver.com/khihome/40114384771 -
Remote Desktop Black screen Windows Server 2008 r2
Remote Desktop Black screen Windows Server 2008 r2Nick van Vuren29/08/2014 NoComments on Remote Desktop Black screen WindowsServer 2008 r2When a users tries to log on, the workstation or server hangs on a blankscreen/black screen.With the administrator account, i found in the registry the followingWarning:EVENT ID 4006The Windows logon process has failed tospawn a user application. Application name: . Command line parameters:C:\Windows\system32\userinit.exe.To fix this issue, i had to add the groups NT AUTHORITY\Authenticated Usersand the NT AUTHORITY\INTERACTIVE to the local group “Users”.After this, the user was able to log on again and the Desktop did showup. -
Set database from SINGLE USER mode to MULTI USER
Set database from SINGLE USER mode to MULTI USERuse masterGOdeclare @sql as varchar(20), @spid as intselect @spid = min(spid) from master..sysprocesses where dbid = db_id(‘sample’) and spid != @@spidwhile (@spid is not null)beginprint ‘Killing process ‘ + cast(@spid as varchar) + ‘ …’set @sql = ‘kill ‘ + cast(@spid as varchar)exec (@sql)select@spid = min(spid)frommaster..sysprocesseswheredbid = db_id(‘sample’)and spid != @@spidendALTER DATABASE DB_NAME SET MULTI_USER; GO———————————————–selectd.name,d.dbid,spid,login_time,nt_domain,nt_username,loginamefrom sysprocesses pinner join sysdatabases don p.dbid = d.dbidwhere d.name = ‘sample’GOYou can add the option to rollback your change immediately.ALTER DATABASE DB_NAMESET MULTI_USERWITH ROLLBACK IMMEDIATEUSE master;GOALTER DATABASE sampleSET SINGLE_USERWITH ROLLBACK IMMEDIATE;GOALTER DATABASE sampleSET READ_ONLY;GOALTER DATABASE sampleSET MULTI_USER;GO–Make Database Read OnlyUSE [master]GOALTER DATABASE sample SET READ_ONLY WITH NO_WAITGO–Make Database Read/WriteUSE [master]GOALTER DATABASE sample SET READ_WRITE WITH NO_WAITGO -
ms sql server database restore
데이타베이스 복원.
http://m.blog.naver.com/mavis5/10079514586https://msdn.microsoft.com/ko-kr/library/ms189272(v=sql.120).aspx— 복구 준비USE MSDBGO효— 백업파일 확인 (TYPE:D – 풀, L – 로그, I – 차등백업)SELECT BACKUP_START_DATE, TYPE, DATABASE_NAME, PHYSICAL_DEVICE_NAMEFROM MSDB.DBO.BACKUPSET A JOIN MSDB.DBO.BACKUPMEDIAFAMILY B ON A.MEDIA_SET_ID = B.MEDIA_SET_IDWHERE DATABASE_NAME = ‘ELOC2001’AND BACKUP_START_DATE > GETDATE() – 2ORDER BY BACKUP_START_DATE DESC— 풀백업 파일 정보 확인RESTORE HEADERONLY FROM DISK = @FILEPATH –‘L:\SQL_BACKUP\AAA.FULLRESTORE FILELISTONLY FROM DISK = @FILEPATH –‘L:\SQL_BACKUP\AAA.FULL— 복구 진행USE MASTERGO— 복구모델이 SIMPLE인경우— 1. 풀백업 복구 백업진행RESTORE DATABASE @DB_NAMEFROM DISK = @FILEPATH WITH NORECOVERY–, REPLACE — 복구시 기존 파일 교체할 때–, MOVE ‘@LOGICAL_NAME’ TO ‘@PYSICAL_PATH’ — 복구시 파일 위치 변경할 때— 2. 차등백업 복구 (해당하는경우 만)RESTORE DATABASE @DB_NAMEFROM DISK= @FILEPATH WITH NORECOVERY— 3. 복구 마무리RESTORE DATABASE @DB_NAME WITH RECOVERY— 4. 다중 사용자로 변경ALTER DATABASE @DB_NAME SET MULTI_USER— 복구모델이 FULL, BULK_LOGGED인경우 (차등백업, 로그백업 사용한다)— 0. 비상로그 백업 : 마지막 로그 백업로 사용BACKUP LOG @DB_NAME TO DISK = @FILEPATHWITH NORECOVERY — db상태를 복구중으로 변경한다 -> DB 변경사항 없게 한다!–, { CONTINUE_AFTER_ERROR | NO_TRUNCATE }— 1. 풀백업 복구RESTORE DATABASE @DB_NAME FROM DISK = @FILEPATH WITH NORECOVERY–, MOVE ‘@LOGICAL_NAME’ TO ‘@PYSICAL_PATH’ — 복구시 파일 위치 변경할 때— 2. 차등백업 복구 (해당하는경우 만)RESTORE DATABASE @DB_NAME FROM DISK= @FILEPATH WITH NORECOVERY— 3. 로그백업 복구RESTORE LOG @DB_NAME FROM DISK=@LOG_BAL_FILE_1_PATH WITH NORECOVERYRESTORE LOG @DB_NAME FROM DISK=@LOG_BAL_FILE_2_PATH WITH NORECOVERYRESTORE LOG @DB_NAME FROM DISK=@LOG_BAL_FILE_3_PATH WITH NORECOVERYRESTORE LOG @DB_NAME FROM DISK=@LOG_BAL_FILE_4_PATH WITH NORECOVERY–, STOPAT = ‘0000-00-00 00:00:00.000’ — 지정시간 복구— 4. 복구 마무리RESTORE DATABASE @DB_NAME WITH RECOVERY— 5. 다중 사용자로 변경ALTER DATABASE @DB_NAME SET MULTI_USER