php icon indicating copy to clipboard operation
php copied to clipboard

Add a local PHP configuration example

Open smth opened this issue 5 years ago • 5 comments

Question

Could you add an example of how to configure now-php to work with now dev? On this page it says "check that PHP executable is added to the PATH environment variable". I'm guessing this means create a .env file and put something like PATH=/⁨usr⁩/local⁩/⁨Cellar/[email protected]⁩/⁨7.3.15⁩/⁨bin⁩/php in it. Is that right? I tried that and also tried using the path from my .bash_profile, with no luck.

smth avatar Feb 24 '20 16:02 smth

Hi, I prefer starting php app via php -S localhost:8000 (php development server).

f3l1x avatar Mar 12 '20 18:03 f3l1x

Ahh OK, thanks. You do that from the api folder?

(I think that needs to be a capital S btw php -S localhost:8000)

smth avatar Mar 13 '20 09:03 smth

Yup, I was on mobile. xD

php -S localhost:8000 api/index.php (or any other php file).

f3l1x avatar Mar 13 '20 09:03 f3l1x

Using this server, rather than now dev means everything is expected to be inside the api directory, right? If index.php is referencing a CSS file for example. How would you deal with that?

smth avatar Mar 13 '20 11:03 smth

Well, it starts full webserver. All assets are handled properly.

Could you show me your project? It might help.

f3l1x avatar Mar 28 '20 20:03 f3l1x