Search code examples
macossymfonynetbeansmamp

Configure Netbeans to use Symfony - OSX


Symfony does not offer an installer package to be downloaded anymore, so I can't point an installer when Netbeans asks me to.

I am working with OSX Sierra. Also coudln't run mysql directly, so I installed MAMP.

That's what I need: run Symfony from Netbeans, using PHP and Mysql from MAMP.

I could run the installer throuh the terminal, but that creates a folder which works with the buil-in PHP server, and when I move it to my MAMP main folder and try to create a new project (in Netbeans) from exisiting resources, it seems to work but then I have no commands available to run.


Solution

  • Open a terminal in your OSX Sierra machine.

    As you can see in the doc you need to execute those 3 commands to get the Symfony installer (it is a symphony.phar file)

     sudo mkdir -p /usr/local/bin
     sudo curl -LsS https://symfony.com/installer -o /usr/local/bin/symfony
     sudo chmod a+x /usr/local/bin/symfony
    

    After having executed those 3 commands you will get a Symfony.phar file in your global environnement. It's written in the doc:

    In Linux and macOS, a global symfony command is created.

    So Now you can go to the www (or htdocs) directory of Mamp (or xampp or wamp) to create a new Symfony project by executing that command:

    symfony new my_project_name
    

    Everything is dscribed here in the doc https://symfony.com/doc/current/setup.html

    If the Symfony.phar file would not have been put in the global environnement by the console command then you would have had to put the Symfony.phar in your www (or htdocs) directory and create a new Symfony project with that command

    php symfony.phar new my_project_name
    

    I Hope this will help you.