PHP 5 ha raggiunto la fine del supporto e verrà
ritirato
il 31 gennaio 2026. Dopo il ritiro, non potrai eseguire il deployment di applicazioni PHP 5, anche se la tua organizzazione ha utilizzato in precedenza un criterio dell'organizzazione per riattivare i deployment di runtime legacy. Le tue applicazioni PHP
5 esistenti continueranno a essere eseguite e a ricevere traffico dopo la
data di ritiro. Ti consigliamo di eseguire la migrazione all'ultima versione supportata di PHP.
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Il server di sviluppo locale (dev_appserver.py) fa parte dei componenti di App Engine dell'interfaccia a riga di comando gcloud. Questo argomento fornisce informazioni avanzate sull'utilizzo di dev_appserver.py.
Per ulteriori informazioni sui test locali, consulta la sezione Utilizzare il server di sviluppo locale.
Configurare lo strumento del server di sviluppo locale
Un comando dev_appserver.py di esempio potrebbe avere il seguente aspetto:
DEVAPPSERVER_ROOT con il percorso della directory principale
in cui estrai la versione archiviata di devapp_server.py. Per ulteriori informazioni sul download e sull'utilizzo della versione archiviata di dev_appserver.py, consulta Utilizzare il server di sviluppo locale.
OPTION con un flag supportato dal server di sviluppo locale.
FILES specifica uno o più file app.yaml, uno per servizio, per l'argomento posizionale yaml_path.
Per un elenco completo delle opzioni, esegui il seguente comando:
Ritirata. Come il data store locale assegna gli ID automatici. Le opzioni sono
sequential o scattered. Il valore predefinito è scattered.
--admin_host=ADMIN_HOST
Nome host a cui deve essere associata la console di amministrazione del server di sviluppo locale (valore predefinito: localhost).
--admin_port=ADMIN_PORT
Porta a cui deve essere associata la console di amministrazione del server di sviluppo locale (valore predefinito: 8000).
--clear_datastore=yes|no
Svuota i dati e i file di cronologia del data store prima di avviare il server web.
Il valore predefinito è no.
--datastore_path=...
Il percorso da utilizzare per il file di dati del datastore locale. Il server crea questo
file se non esiste.
--enable_sendmail=yes|no
Utilizza l'installazione di Sendmail del computer locale per
inviare messaggi email.
--enable_task_running=yes|no
Consente al server di sviluppo di eseguire attività push. Il valore predefinito è yes.
Se specifichi no, il server non eseguirà le attività push.
--help
Stampa un messaggio utile e poi esce.
--host=...
L'indirizzo host da utilizzare per il server. Potresti dover impostare questa opzione per poter accedere al server di sviluppo da un altro computer della rete. Un
indirizzo 0.0.0.0 consente sia l'accesso a localhost sia l'accesso all'IP o al nome host.
Il valore predefinito è localhost.
--log_level=...
Il livello di logging più basso a cui i messaggi di logging verranno scritti nella console. Verranno visualizzati i messaggi del livello di logging specificato o superiore.
I valori possibili sono debug, info, warning, error e critical.
--port=...
Il numero di porta da utilizzare per il server. Il valore predefinito è 8080. Se vengono avviati più server, ad esempio per i servizi, verranno assegnate porte successive, ad esempio 8081, 8082.
--logs_path=...
Per impostazione predefinita, i log del server di sviluppo locale vengono archiviati solo in memoria. Specifica questa opzione quando esegui il server di sviluppo locale per archiviare
i log in un file, in modo che siano disponibili durante i riavvii del server.
Devi specificare il percorso della directory e il nome di un file del database SQLite. Se il file non esiste già, viene creato un file del database SQLite con il nome specificato. Ad esempio: --logs_path=/home/logs/boglogs.db
--require_indexes=yes|no
Disattiva la generazione automatica delle voci nel file index.yaml. Al contrario,
quando l'applicazione esegue una query che richiede che l'indice sia definito nel
file e la definizione dell'indice non viene trovata, viene sollevata un'eccezione,
simile a quanto accadrebbe durante l'esecuzione su App Engine. Il valore predefinito è
no.
--smtp_host=...
Il nome host del server SMTP da utilizzare per l'invio di messaggi email.
--smtp_port=...
Il numero di porta del server SMTP da utilizzare per l'invio dei messaggi email.
--smtp_user=...
Il nome utente da utilizzare con il server SMTP per l'invio di messaggi email.
--smtp_password=...
La password da utilizzare con il server SMTP per l'invio di messaggi email.
--storage_path=...
Percorso in cui verranno archiviati tutti i file locali, ad esempio i file e i log di Datastore, Blobstore e Cloud Storage, a meno che non vengano sostituiti da --datastore_path, --blobstore_path o --logs_path.
--support_datastore_emulator=yes|no
Utilizza l'emulatore Cloud Datastore (beta) per l'emulazione del datastore locale.
--datastore_emulator_port=...
Il numero di porta da utilizzare per l'emulatore Cloud Datastore (beta).
--env_var=...
Variabile di ambiente definita dall'utente per il processo di runtime locale. Ogni env_var ha il formato chiave=valore e puoi definire più variabili di ambiente. Oltre a env_variables in app.yaml, questo
flag consente di impostare variabili di ambiente aggiuntive per i processi locali.
Ad esempio:--env_var KEY_1=val1 --env_var KEY_2=val2
--php_executable_path=...
Percorso del file binario php-cgi.
--php_gae_extension_path=...
Percorso del file binario gae_runtime_module.so.
--php_remote_debugging=yes|no
Imposta su yes per attivare il debug remoto con XDebug
[[["Facile da capire","easyToUnderstand","thumb-up"],["Il problema è stato risolto","solvedMyProblem","thumb-up"],["Altra","otherUp","thumb-up"]],[["Difficile da capire","hardToUnderstand","thumb-down"],["Informazioni o codice di esempio errati","incorrectInformationOrSampleCode","thumb-down"],["Mancano le informazioni o gli esempi di cui ho bisogno","missingTheInformationSamplesINeed","thumb-down"],["Problema di traduzione","translationIssue","thumb-down"],["Altra","otherDown","thumb-down"]],["Ultimo aggiornamento 2025-09-04 UTC."],[[["\u003cp\u003eThe \u003ccode\u003edev_appserver.py\u003c/code\u003e is a local development server tool within the App Engine components of the gcloud CLI, used for testing applications locally.\u003c/p\u003e\n"],["\u003cp\u003eBefore running \u003ccode\u003edev_appserver.py\u003c/code\u003e, it is required to use Python 3 and set the \u003ccode\u003eCLOUDSDK_DEVAPPSERVER_PYTHON\u003c/code\u003e environment variable to the path of your Python 2 interpreter.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003edev_appserver.py\u003c/code\u003e command utilizes flags like \u003ccode\u003e--admin_port\u003c/code\u003e, \u003ccode\u003e--host\u003c/code\u003e, and \u003ccode\u003e--port\u003c/code\u003e to configure the local development server, among others, and can also leverage various other options as displayed by the \u003ccode\u003e-h\u003c/code\u003e command.\u003c/p\u003e\n"],["\u003cp\u003eThe local server can use different features like sending email, or push task by setting up different flags like \u003ccode\u003e--enable_sendmail\u003c/code\u003e and \u003ccode\u003e--enable_task_running\u003c/code\u003e to yes.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003e--storage_path\u003c/code\u003e flag can be used to specify the location of local files such as Datastore, Blobstore, Cloud Storage files and logs, that will be stored unless the more specific datastore, blobstore, or logs flag is used instead.\u003c/p\u003e\n"]]],[],null,["# Local Development Server Options\n\nThe local development server (`dev_appserver.py`) is part of the App Engine\ncomponents of the [gcloud CLI](/sdk/docs). This topic provides advanced\ninformation about the `dev_appserver.py` usage.\n\n\nSee [Using the Local Development Server](/appengine/docs/legacy/standard/php/tools/using-local-server)\nfor more information about local testing.\n\n\nSet up the local development server tool\n----------------------------------------\n\n| **Important:** Before running the local development server, follow the [setup instructions](/appengine/docs/legacy/standard/php/tools/using-local-server#set-up). Regardless of your app's runtime or language version, you must run `dev_appserver.py` with Python 3 and set the `CLOUDSDK_DEVAPPSERVER_PYTHON` environment variable in your shell to the path of your Python 2 interpreter.\n\nA sample `dev_appserver.py` command might look as follows: \n\n python2 \u003cvar translate=\"no\"\u003eDEVAPPSERVER_ROOT\u003c/var\u003e/google_appengine/dev_appserver.py \u003cvar translate=\"no\"\u003eOPTION\u003c/var\u003e yaml_path \u003cvar translate=\"no\"\u003eFILES\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eDEVAPPSERVER_ROOT\u003c/var\u003e with the path to the root directory where you extract the archived version of `devapp_server.py`. For more information about downloading and using the archived version of `dev_appserver.py`, see [Using the local development server](/appengine/docs/legacy/standard/php/tools/using-local-server#before_you_begin).\n- \u003cvar translate=\"no\"\u003eOPTION\u003c/var\u003e with a flag supported by the local development server.\n- \u003cvar translate=\"no\"\u003eFILES\u003c/var\u003e specifies one or more `app.yaml` files, one per service, for the positional argument `yaml_path`.\n\nFor a complete list of options, run the following:\n\n\u003cvar translate=\"no\"\u003eDEVAPPSERVER_ROOT\u003c/var\u003e/google_appengine/dev_appserver.py -h\n\nCommon options\n--------------\n\nThe most common options are as follows:\n\n`--auto_id_policy=...`\n: Deprecated. How the local datastore assigns automatic IDs. Options are\n `sequential` or `scattered`. The default is `scattered`.\n\n`--admin_host=ADMIN_HOST`\n: Host name to which the local development server's administration console\n should bind (default: localhost).\n\n`--admin_port=ADMIN_PORT`\n: Port to which the local development server's administration console should\n bind (default: 8000).\n\n`--clear_datastore=yes|no`\n: Clears the datastore data and history files before starting the web server.\n The default is `no`.\n\n`--datastore_path=...`\n: The path to use for the local datastore data file. The server creates this\n file if it does not exist.\n\n`--enable_sendmail=yes|no`\n: Uses the local computer's Sendmail installation for\n sending email messages.\n\n`--enable_task_running=yes|no`\n: Enables the development server to run push tasks. The default is `yes`.\n If you specify `no`, the server will not run push tasks.\n\n`--help`\n: Prints a helpful message then quits.\n\n`--host=...`\n: The host address to use for the server. You may need to set this to be able\n to access the development server from another computer on your network. An\n address of `0.0.0.0` allows both localhost access and IP or hostname access.\n Default is `localhost`.\n\n`--log_level=...`\n: The lowest logging level at which logging messages will be written to the\n console; messages of the specified logging level or higher will be output.\n Possible values are `debug`, `info`, `warning`, `error`, and `critical`.\n\n`--port=...`\n: The port number to use for the server. Default is `8080`. If multiple servers\n are launched such as for services, they will be assigned subsequent ports,\n such as `8081`, `8082`.\n\n`--logs_path=...`\n: By default, the logs for the local development server are stored in memory\n only. Specify this option when you run the local development server to store\n the logs into a file, which makes the logs available across server restarts.\n You must specify the directory path and name to a SQLite database file. A\n SQLite database file is created with the specified name if the file does not\n already exist. For example: `--logs_path=/home/logs/boglogs.db`\n\n`--require_indexes=yes|no`\n: Disables automatic generation of entries in the `index.yaml` file. Instead,\n when the application makes a query that requires that its index be defined in\n the file and the index definition is not found, an exception will be raised,\n similar to what would happen when running on App Engine. The default value is\n `no`.\n\n\n`--smtp_host=...`\n: The hostname of the SMTP server to use for sending email messages.\n\n`--smtp_port=...`\n: The port number of the SMTP server to use for sending email messages.\n\n`--smtp_user=...`\n: The username to use with the SMTP server for sending email messages.\n\n`--smtp_password=...`\n: The password to use with the SMTP server for sending email messages.\n\n`--storage_path=...`\n: Path at which all local files, such as the Datastore,\n Blobstore, Cloud Storage files and logs, will be stored, unless\n overridden by `--datastore_path`, `--blobstore_path`, or `--logs_path`.\n\n`--support_datastore_emulator=yes|no`\n: Use the Cloud Datastore Emulator (beta) for local datastore emulation.\n\n`--datastore_emulator_port=...`\n: The port number to use for Cloud Datastore Emulator (beta).\n\n`--env_var=...`\n: User defined environment variable for the local runtime process. Each\n `env_var` is in the format of key=value, and you can define multiple\n environment variables. In addition to `env_variables` in the `app.yaml`, this\n flag allows setting extra environment variables for local processes.\n For example:`--env_var KEY_1=val1 --env_var KEY_2=val2`\n\n\n`--php_executable_path=...`\n: Path to the php-cgi binary.\n\n`--php_gae_extension_path=...`\n: Path to the gae_runtime_module.so binary.\n\n`--php_remote_debugging=yes|no`\n: Set to yes to enable remote debugging with XDebug"]]