Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125987 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 7BD4B1A00BD for ; Tue, 19 Nov 2024 12:12:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1732018494; bh=gfCYCQ219KRksdUzRkaXZ1CHTlvFAHM/of5VdZ7k69I=; h=Date:Subject:To:References:From:In-Reply-To:From; b=H0bv2DzDJsgB3IEQGiki1UJW+6Ej+XMQ6ZMnVmvjPNyZoO/jQR9W9JUy8xi8Cr6K8 xMc4r5sld3/L63Q3yJAAHT/F/uEVZdSl5Svm46ZESjWIQKxhHySXhU2cXMUeo6iOcv u4mLUaWnHAbtLaZqp8/y83F1xwBJJx2a2ar4vXPffKSB5iu6zltWGgL1F5r5nngK7f xaDp2cAh5+y5PuXuU/qMP5Yfs6HkanzSWylpsOnEzyOpt8tOAHBZOWB9bD8I8nrK+Q GvufWdRNQY71/sxG6XH8C1rTaeT3TxWRUM/tlJp1rEHAT8yHHGsx4x6UMMf92U9Abt T0NEHfVujjhRw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 885DA18004D for ; Tue, 19 Nov 2024 12:14:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Tue, 19 Nov 2024 12:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1732018331; x=1732623131; i=cmbecker69@gmx.de; bh=ZyjjN8+CZzabgGfl+bGyrkodBIhUTyxWS8gIUqeVir0=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To: References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=i1MhwEoMOUmIe4x5HryegZbDbx7WwnDAmnfROeR0iymrLKQ1qdmFAIfZr9lB3pXe HweuuUWzlYLe5DYfLQVjeL9tX9MMkvh91BnMiEeo2W2cTRAqgqTUK73VRJazMYkYp GvOSSgRtPwyOnXJ0cU25y1xw4EsOLHT24pedzdwwqz0vt5daYnSuJb5Hoyk4pSyEt nS5PL0l5vKGlSbmQ8axP4pb/T++/VSLdIL/t6GOZZ1EmI3Blis52hEnAo+TOYxtA0 LYnYPAvRjEgYO+35mD29n20u2fcPcYOAj8PiJyUPpnOEvc2kX7BitjbDJpBfIv7il sVcXDM6FqZQx5Pdq3w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.2.130] ([79.251.205.37]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MgvrB-1tf2Oc2bs5-00fz2D; Tue, 19 Nov 2024 13:12:11 +0100 Message-ID: <8398d162-569d-4095-905d-7fb1c6c43051@gmx.de> Date: Tue, 19 Nov 2024 13:12:11 +0100 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PHP-DEV] Better development streamlining of the built-in server To: John D'Orazio , internals@lists.php.net References: <25ebe5db-6db4-4fe7-b75e-07ae43443ee3@email.android.com> Content-Language: de-DE In-Reply-To: <25ebe5db-6db4-4fe7-b75e-07ae43443ee3@email.android.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Hgi2iOHf8nL39hZrgyb93NvjT+w9SzNh5qxAGHW2H+MDSYi1vCg c1WUTIhb+hYDRRmMxETTfsXf+NJAFsT/JYzi2x1ZJanmM8WhYgGKIB82zP9OLN1+eSmDIfH dDnKIwSTMzyntIwT9wlhX7h8fkVhbO7tEnlw7Ql1hWMiAqB9GbzMXxyvtMS9W48Mc5AZvrv rVeqLRcd+SqCRfd5aw22g== UI-OutboundReport: notjunk:1;M01:P0:O8mI73SxLT0=;XRxIS5kETSeExD/dxoe6cuWmbxv BsSVEtCljmurMfkSrgfSdsdyp9BSSEElj3bRGrHXI9XTGzWqqc4NNU7r/o77cjiZyZLKwUzcE lCz0M9vKV+C7NxD3enWI0eI8Gl8y3ZJfiuJjJWOJR7XxYtUUcWJ4D/oYe9CjOvldVcXrQN0aM 52S5BUelzXJn6P16b/HBL3ek0iW6h2voF8qiZLN14g+wSe+gwjNQCyD12g7VJ3DIGfcTsqG19 gn3qtBUSQTH6I+R1D1syDJFW3/JANTrDwJSP/J5ctQSYjXhUdCy/EWgU3Vf1mOQNYYlImHNJf k4JcdeFzEDpJNaeanT9nBNxIiuW0Aod76Acd4xvarlipDwhYA5Mu12nFHUoCKc0Jc+jljbsH8 VOIkVOn5sAw9Q6XBDNL+25od2TmGNNjJjYU/bPpuUjSD6TUncXWtg/nI40tmiJ9qNrGWP2kZ+ 7gZDEZMaDRLgT0mbaiWHLA7OhVBb51ZNNfxl5fBmvpzaAGB184MAzU9otDWzRd77xgRRu6kKD nWjFHeoHFO41KmgY+Oq2f3BPrhkdD4VIlZ+iWMuqQT8oEyWlkJdu8t2cdkWpZJGYlqkpay7wG Lz9Vsb5Qo/W3TIP34+qfwdnn0TMGe95kL1MU6T4JCaiIvrGAlAJHewh9dC8T3gTc7fFzrlcJ2 KmdoyuxyFB4LZipFi+K8lsyQx1RPUsmEOfWbEmq2kPJS7k1/UonXQxgRto2iAyGlYyZtsZm5N KFQ2aIkcVxxRa76qohuKoMTkflaYdzZMorbwEwHHTNUM0R8ibLOv3X02BHwJLZMlJLH/3E/vU j9jOvrblF0e2jjSNNY2OYu5hX66F/CldsooSg+fHveNOpBBthKZOLTQ2AMuZxtuWWoD14YNS+ 0EMPVYbocZpmxllOXwIZy1tp7guN1RR9+sz2TeNK62jtFa5XNypcFZHdG From: cmbecker69@gmx.de ("Christoph M. Becker") On 19.11.2024 at 03:33, John D'Orazio wrote: > [=E2=80=A6] I even recently discovered the great > feature that was introduced in PHP 7.4 `PHP_CLI_SERVER_WORKERS`, which I= sorely > needed because my API makes a couple of requests internally to various p= aths of > the API, and nested requests require more than one process / worker, whi= ch > wasn't a problem for the Nginx / Apache production server but would have= been a > problem on localhost using the built-in server if it weren't for this > environment variable. > > Seeing I have a number of people interested in contributing to the proje= ct, they > have been asking me how they can develop on localhost without the troubl= e of > setting up a whole WAMP environment. [=E2=80=A6] I don't quite understand how WAMP fits into this. WAMP is Windows only, and on Windows `PHP_CLI_SERVER_WORKERS` is not supported. > In my use case, I have an API backend that I can spin up with `php -S > localhost:8000`. Then when I spin up the frontend (which is also written= in > PHP), it knows nothing about where to find the API backend. On the produ= ction > server, I had the host hardcoded into the frontend application. But if I= want to > be able to dynamically switch between localhost and production, I need t= o be > able to instruct the frontend of where to find the API backend. This can= easily > be achieved through dotenv files, and even better if we have an automati= c > environment variable of `$_ENV[APP_ENV]=3Ddevelopment`. I see that there= is a > composer package (https://github.com/vlucas/phpdotenv) that can achieve = loading > dotenv files, but other than loading dotenv files by means of a composer= package > it would be nice if we could at least have an automatic environment vari= able of > `$_ENV[APP_ENV]=3Ddevelopment` created by PHP's built-in server. Seeing = that the > built-in server will pretty much always be used for easy localhost devel= opment, > I don't see any reason why a `development` environment variable couldn't= or > shouldn't be created by the built-in server? It would make PHP localhost > development that much more user friendly in my opinion... Besides that setting an environment globally is not necessarily possible, this looks somewhat backwards to me, and is in my opinon way too special =E2=80=93 why would only the built-in development server adver= tize itself as a development environment? Christoph