PHP 5는 지원이 종료되었으며 2026년 1월 31일에 지원 중단됩니다. 지원 중단 후에는 조직에서 이전에 조직 정책을 사용하여 레거시 런타임의 배포를 다시 사용 설정한 경우에도 PHP 5 애플리케이션을 배포할 수 없습니다. 기존 PHP 5 애플리케이션은 지원 중단 날짜 이후에도 계속 실행되고 트래픽을 수신합니다. 지원되는 최신 PHP 버전으로 마이그레이션하는 것이 좋습니다.
소켓의 트래픽 요금은 발신 대역폭으로 청구됩니다.
App Engine에서는 fsockopen과 같은 표준 PHP 라이브러리의 메서드를 사용하여 아웃바운드 소켓을 지원합니다.
지원되는 옵션의 경우 socket_get_option을 호출하면 모의 값이 반환되고 socket_set_option을 호출하면 자동으로 무시됩니다. 지원되지 않는 옵션에 대해서는 오류가 계속 발생합니다.
지원되는 옵션은 다음과 같습니다.
SO_KEEPALIVE
SO_DEBUG
TCP_NODELAY
SO_LINGER
SO_OOBINLINE
SO_SNDBUF
SO_RCVBUF
SO_REUSEADDR
제한 및 제약사항
App Engine의 소켓 지원에는 다음과 같은 제한사항이 있습니다.
리슨 소켓을 만들 수 없으며 아웃바운드 소켓만 만들 수 있습니다.
FTP는 지원되지 않습니다.
TCP 또는 UDP만 사용할 수 있습니다. 임의 프로토콜은 허용되지 않습니다.
특정 IP 주소 또는 포트로 바인딩할 수 없습니다.
포트 25(SMTP)가 차단됩니다. 제출 포트 587에서 인증된 SMTP를 계속 사용할 수 있습니다.
비공개, 브로드캐스트, 멀티캐스트, Google IP 범위는 아래 나열된 항목을 제외하고 차단됩니다.
Google Public DNS: 8.8.8.8, 8.8.4.4, 2001:4860:4860::8888, 2001:4860:4860::8844 포트 53
Gmail SMTPS: smtp.gmail.com 포트 465 및 587
Gmail POP3S: pop.gmail.com 포트 995
Gmail IMAPS: imap.gmail.com 포트 993
소켓 설명자는 자신을 만든 App Engine 앱에 연결되며 전송될 수 없습니다(다른 앱에서 사용 불가).
비활성 상태가 10분간 지속되는 소켓은 회수할 수 있습니다. 모든 소켓 작업에서 소켓이 10분 더 활성 상태로 유지됩니다.
개발 서버와 소켓 사용
특수 명령줄 매개변수를 사용하지 않고 개발 서버에서 소켓을 사용하여 코드를 실행 및 테스트할 수 있습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[[["\u003cp\u003eThis socket API is not recommended anymore, as apps using it are limited to the PHP 5 runtime and need to migrate to a different solution before upgrading to PHP 7/8.\u003c/p\u003e\n"],["\u003cp\u003eApp Engine supports outbound sockets through standard PHP library methods like \u003ccode\u003efsockopen\u003c/code\u003e, with limited options for \u003ccode\u003esocket_get_option\u003c/code\u003e and \u003ccode\u003esocket_set_option\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eOnly outbound sockets are allowed; creating listen sockets is not possible, and certain protocols like FTP and arbitrary protocols are unsupported.\u003c/p\u003e\n"],["\u003cp\u003eSpecific restrictions apply, such as the inability to bind to specific IPs or ports, the blocking of port 25, and the blocking of private, broadcast, and multicast IP ranges, except for specific Google services like Google Public DNS and Gmail.\u003c/p\u003e\n"],["\u003cp\u003eSockets are non-transferable and may be automatically reclaimed after 10 minutes of inactivity, with any socket operation extending their life by another 10 minutes.\u003c/p\u003e\n"]]],[],null,["# Sockets API for legacy bundled services\n\n| **Caution:** **This solution is no longer recommended:** Apps that use this API can only run in the PHP 5 runtime and will need to upgrade to a [recommended solution](/appengine/migration-center/standard/services/migrating-services) before migrating to the PHP 7/8 runtime.\n\nTraffic from sockets is billed as [outgoing bandwidth](/appengine/docs/pricing#Billable_Resource_Unit_Costs). App Engine supports outbound sockets using methods from the standard PHP library such as [`fsockopen`](http://www.php.net/function.fsockopen). For supported options, calls to [`socket_get_option`](http://php.net/manual/en/function.socket-get-option.php) will return a mock value and calls to [`socket_set_option`](http://www.php.net/manual/en/function.socket-set-option.php) will be silently ignored. Errors will continue to be raised for unsupported options. The supported options are:\n\n\u003cbr /\u003e\n\n- `SO_KEEPALIVE`\n- `SO_DEBUG`\n- `TCP_NODELAY`\n- `SO_LINGER`\n- `SO_OOBINLINE`\n- `SO_SNDBUF`\n- `SO_RCVBUF`\n- `SO_REUSEADDR`\n\nLimitations and restrictions\n----------------------------\n\nSocket support in App Engine has the following limitations:\n\n- You cannot create a listen socket; you can only create outbound sockets.\n- FTP is not supported.\n- You can only use TCP or UDP; arbitrary protocols are not allowed.\n- You cannot bind to specific IP addresses or ports.\n- Port 25 (SMTP) is blocked; you can still use authenticated SMTP on the submission port 587.\n- Private, broadcast, multicast, and Google IP ranges are blocked, except\n those listed below:\n\n - Google Public DNS: `8.8.8.8`, `8.8.4.4`, `2001:4860:4860::8888`, `2001:4860:4860::8844` port 53\n - Gmail SMTPS: `smtp.gmail.com` port 465 and 587\n - Gmail POP3S: `pop.gmail.com` port 995\n - Gmail IMAPS: `imap.gmail.com` port 993\n\n | **Note:** Google Compute Engine IP addresses are not considered to be in Google IP ranges. You can use sockets to connect App Engine apps to Compute Engine instances.\n- Socket descriptors are associated with the App Engine app that\n created them and are non-transferable (cannot be used by other apps).\n\n- Sockets may be reclaimed after 10 minutes of inactivity; any socket operation\n keeps the socket alive for a further 10 minutes.\n\n\n Using sockets with the development server\n -----------------------------------------\n\n You can run and test code using sockets on the development server, without using\n any special command line parameters."]]