How to use PHP Composer on HostGator

前端 未结 3 1384
南方客
南方客 2020-12-23 11:21

I recently decided to start a project in Zend Framework 2 and was having trouble getting it to run on a HostGator shared server.

By default, HostGator\'s shared serv

相关标签:
3条回答
  • 2020-12-23 12:02

    If you still get errors just put this lini in your php.ini:

    suhosin.executor.include.whitelist = phar
    
    0 讨论(0)
  • 2020-12-23 12:08

    First off, you can enable PHP 5.3 on HostGator on a directory level basis. Simply add the following line to the .htaccess file in your public directory:

    AddType application/x-httpd-php53 .php reference link

    Ba-Da-Bing! Now you can run your PHP 5.3 applications!

    Oh, but wait! You have SSH access and want to use PHP Composer?
    If you log in via SSH and try the following command: # php composer.phar install you will get the following error: Fatal error: Class 'Phar' not found in...

    This is because HostGator's # php command runs in 5.2.2. To run in 5.3, you need to provide the full path to the 5.3 binary.

    Here's the working command:
    # /opt/php53/bin/php composer.phar install

    I was so excited that I got this working that I figured I would share!

    0 讨论(0)
  • 2020-12-23 12:09

    There is an option in Hostgator CPanel. Just go to PHP Configuration and choose one of PHP versions. Now you can choose between 5.2, 5.3, 5.4 and 5.5.

    0 讨论(0)
提交回复
热议问题