Phalcon installation on ubuntu 16.04 LTS with XAMPP server

Hi, I hope you have a good day, I need your help.

I do not know how to install Phalcon 3 in my version of ubuntu. I would like you to indicate to me every step I have to take, thank you very much!

Please!



1.1k
edited 12d ago

Have you looked at the installation documentation ? https://phalconphp.com/en/download/linux

This should install the needed source.list and key for phalcon packages. It will also update the packages on your system. So no need to run an apt-get update afterwards.

curl -s "https://packagecloud.io/install/repositories/phalcon/stable/script.deb.sh" | sudo bash

This should give you a list of all the packages that are related to phalcon

sudo apt-cache search phalcon

Below is the list of packages that I have access to. I have multiple php versions running at the same time on that server.

[email protected]:/etc/apt# apt-cache search phalcon
php7.0-phalcon - High performance PHP framework
php7.0-phalcon-dbg - Debug symbols for php7.0-phalcon
php7.0-phalcon-dbgsym - Debug symbols for php7.0-phalcon
php7.1-phalcon - High performance PHP framework
php7.1-phalcon-dbgsym - Debug symbols for php7.1-phalcon
php7.2-phalcon - High performance PHP framework
php7.2-phalcon-dbgsym - Debug symbols for php7.2-phalcon
php-phalcon - full-stack PHP framework delivered as a C-extension
php-phalcon-dbgsym - Debug symbols for php-phalcon

To install the latest phalcon for php 7.2 I only need to run the command below

sudo apt-get install php7.2-phalcon

And that should be it. Restart your apache2 service and you should be ready to use phalcon. Create a php file and put phpinfo in it and run it, search for phalcon (CTRL F). You should see that is is enabled.

<?php
  phpinfo();
?>

This is what happens to me when creating a new project with devtools.

Fatal error: Uncaught Error: Class 'Phalcon\Di\FactoryDefault' not found in /opt/lampp/htdocs/store/public/index.php:15 Stack trace: #0 {main} thrown in /opt/lampp/htdocs/store/public/index.php on line 15



36.3k

Hi Mateo, please start a new thread if you're experiencing troubles after a new app creation with the phalcondetools.

Hi hoet, thank you for sharing.

edited 12d ago

Hi @le51, i could already install phalcon very well, but I get an error with the mod_rewrite.

"Mod-Rewrite is not enabled" after solving it in apache2.conf, I get the error: Fatal error: Uncaught Error: Class 'Phalcon\Di\FactoryDefault' not found in /var/www/test/public/index.php:22 Stack trace: #0 {main} thrown in /var/www/test/public/index.php on line 22



36.3k
edited 12d ago

Fatal error: Uncaught Error: Class 'Phalcon\Di\FactoryDefault' not found

it looks like phalcon extension isn't loaded, double check your php configuration



1.1k

Have you tried to create a test.php file with phpinfo in it ?

Do that and search for the phalcon part. It should look something like this.

This means that phalcon is enabled. If you do not see this then phalcon is not enabled on your server. It might be that the phalcon extension is not loaded. You should have a look in the apache2 log file (/var/log/apache2/error.log).



6.0k

Your title mentions XAMPP. From looking at problems with XAMPP, XAMPP stores some settings in XAMPP files instead of standard Apache and PHP files. You may have to edit a XAMPP file to add Phalcon.