How to run a PHP script from the command line with MAMP?

前端 未结 4 1713
一整个雨季
一整个雨季 2020-12-12 19:26

I have MAMP installed. Now I am trying to run a script from the command line, but I can\'t seem to get it to work.

How should I set up my environment so that I can r

4条回答
  •  旧巷少年郎
    2020-12-12 19:56

    Run this in your Terminal:

    export PATH=/Applications/MAMP/bin/php5/bin/:$PATH
    

    Should do the trick. It will - as Tom Haigh mentioned - add the MAMP PHP executable to the path so you can use "php" instead of the full path.

提交回复
热议问题