PHP 5 telah mencapai akhir dukungan dan akan
dihentikan penggunaannya
pada 31 Januari 2026. Setelah penghentian penggunaan, Anda tidak akan dapat men-deploy aplikasi PHP 5, meskipun organisasi Anda sebelumnya menggunakan kebijakan organisasi untuk mengaktifkan kembali deployment runtime lama. Aplikasi PHP 5 yang sudah ada akan terus berjalan dan menerima traffic setelah
tanggal penghentiannya. Sebaiknya Anda bermigrasi ke versi PHP terbaru yang didukung.
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Traffic dari soket ditagih sebagai bandwidth keluar.
App Engine mendukung soket keluar menggunakan metode dari library PHP standar seperti fsockopen.
Untuk opsi yang didukung, panggilan ke
socket_get_option
akan menampilkan nilai tiruan dan panggilan ke
socket_set_option
akan menjadi diabaikan secara diam-diam. Error akan terus dilaporkan untuk opsi yang tidak didukung.
Opsi yang didukung adalah:
SO_KEEPALIVE
SO_DEBUG
TCP_NODELAY
SO_LINGER
SO_OOBINLINE
SO_SNDBUF
SO_RCVBUF
SO_REUSEADDR
Pembatasan dan batasan
Dukungan socket di App Engine memiliki batasan berikut:
Anda tidak dapat membuat soket pemrosesan; Anda hanya dapat membuat soket keluar.
FTP tidak didukung.
Anda hanya dapat menggunakan TCP atau UDP; protokol arbitrer tidak diperbolehkan.
Anda tidak dapat terikat pada alamat IP atau port tertentu.
Port 25 (SMTP) diblokir; Anda masih dapat menggunakan SMTP yang diautentikasi pada
port pengiriman 587.
Rentang IP pribadi, siaran, multicast, dan Google diblokir, kecuali yang tercantum di bawah:
Google Public DNS: 8.8.8.8, 8.8.4.4, 2001:4860:4860::8888,
2001:4860:4860::8844 port 53
SMTP Gmail: smtp.gmail.com port 465 dan 587
POP3S Gmail: pop.gmail.com port 995
IMAPS Gmail: imap.gmail.com port 993
Deskripsi soket dikaitkan dengan aplikasi App Engine yang
membuatnya dan tidak dapat ditransfer (tidak dapat digunakan oleh aplikasi lain).
Soket dapat digunakan kembali setelah 10 menit dalam kondisi tidak aktif; operasi soket apa pun akan
menjaga soket tersebut tetap aktif selama 10 menit lagi.
Menggunakan soket dengan server pengembangan
Anda dapat menjalankan dan menguji kode menggunakan soket di server pengembangan, tanpa menggunakan
parameter command line khusus.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-19 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."]]