-
-
Save Tosyn/fef6437dd3906ff200e471e478eaae95 to your computer and use it in GitHub Desktop.
#!/bin/bash | |
# PhalconPhp with PHP7 installation on ubuntu:16.04 | |
sudo apt-get update | |
sudo apt-get install -y php7.0-fpm \ | |
php7.0-cli \ | |
php7.0-curl \ | |
php7.0-gd \ | |
php7.0-intl \ | |
php7.0-pgsql \ | |
php7.0-mbstring \ | |
php7.0-xml \ | |
php-msgpack \ | |
curl \ | |
vim \ | |
wget \ | |
git | |
# For zephir installtion; the following packages are needed in Ubuntu: | |
sudo apt-get install -y gcc make re2c libpcre3-dev php7.0-dev build-essential php7.0-zip | |
# Install composer | |
sudo curl -sS http://getcomposer.org/installer | php | |
sudo mv composer.phar /usr/local/bin/composer | |
# Install zephir | |
sudo composer global require "phalcon/zephir:dev-master" | |
# Install phalcon dev tool | |
sudo composer require "phalcon/devtools" -d /usr/local/bin/ | |
sudo ln -s /usr/local/bin/vendor/phalcon/devtools/phalcon.php /usr/bin/phalcon | |
# Install phalconphp with php7 | |
sudo git clone https://github.com/phalcon/cphalcon.git -b 2.1.x --single-branch | |
cd cphalcon/ | |
sudo ~/.composer/vendor/bin/zephir build --backend=ZendEngine3 | |
sudo echo "extension=phalcon.so" >> /etc/php/7.0/fpm/conf.d/20-phalcon.ini | |
sudo echo "extension=phalcon.so" >> /etc/php/7.0/cli/conf.d/20-phalcon.ini | |
# some additional php settings if you care | |
sudo sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" /etc/php/7.0/cli/php.ini | |
sudo sed -i "s/;cgi.fix_pathinfo=1/cgi.fix_pathinfo=0/g" /etc/php/7.0/fpm/php.ini | |
sudo sed -i "s/memory_limit = 128M/memory_limit = 256M /g" /etc/php/7.0/fpm/php.ini | |
# restart php-fpm | |
sudo service php7.0-fpm restart |
Added note. To get this to work in the browser I had to:
sudo cp /etc/php/7.0/cli/conf.d/20-phalcon.ini /etc/php/7.0/apache2/conf.d/20-phalcon.ini
sudo service apache2 restart
Another update. In order to get devtools to run I had to comment out lines 58 - 63 of phalcon.php to prevent it from doing the version check. Haven't run it yet to see it works, but I had to do that just to get phalcon commands
to work.
throw new Exception(
sprintf(
"Your Phalcon version isn't compatible with Developer Tools, download the latest at: %s",
Script::DOC_DOWNLOAD_URL
)
);
If anyone else stumbles on to this there is now a stable build of phalcon 3.0.x for php 7 and ubuntu 16.04 on the phalconphp website under the downloads section.
How to run phalcon devtools,i want create project in terminal ???
Easy way:
curl -s "https://packagecloud.io/install/repositories/phalcon/stable/script.deb.sh" | sudo bash
sudo apt-get install php5-phalcon
Ubuntu 16.04+, Debian 9+
sudo apt-get install php7.0-phalcon
If you are on Linux Mint 18 you can get E: Unable to locate package php7.0-phalcon when trying to install php7.0-phalcon.
You can fix it with: sudo apt-add-repository ppa:ondrej/php && sudo apt-get update
@DracoPL thank you so much for your help. Been trying to install phalcon on linux mint serena and failed for about 3 hours... Your solution worked like a charm :D
how install phalcon with xampp in ubuntu 16.04? please help me ..
It works on ubuntu 16.04.3!!!
It works on Debian 9.3 ! Thank you !!
@Tosyn I think what @vkill was saying is that the
# Install phalcon dev tool
section should be at the end because it requires ext-phalcon which I'm guessing is phalcon? If you don't already have a version of phalcon installed than the dev tool install will fail. Incidentally, it doesn't matter because if you install compile this build it will still fail because the version number is different2.1.0r
vs3.0.1
. To fix this @ndaidong and @besingamk you need to add--ignore-platform-reqs
to the composer install. i.e."Just to be clear. I haven't used composer very much and this is the first Phalcon install I've ever done. So, those worked for me but if someone has a better way let me know.
Also these lines didn't work for me:
I got a permission denied error for some reason. I had to log into root and create the files manually.
Edit: Fixed my code formatting