We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

[ERROR] Global 'orm.exception_on_failed_metadata_save' cannot be read

When compiling Phalcon v3.4.4 and v4.0.0.beta.1, the zephir v0.12.0 compiler produces the following error. System Linux raspberrypi 4.19.58-v7+ #1245 SMP Fri Jul 12 17:25:51 BST 2019 armv7l PHP Version 7.3.4-2

[ERROR] Global 'orm.exception_on_failed_metadata_save' cannot be read because it isn't defined in
/home/pi/git/cphalcon/phalcon/Mvc/Model/MetaData.zep on line 715

What is lacking in the environment. What else should I install? phpInfo

edited Aug '19

I figured out the reasons for the error.

This solution applies to all operating system, not just the Rasberry PI. (Excludes clause about swap file increase.)

I ran the installer for version 4.0.0, even though I copied version 3.4.4 from the repository.


\$ sudo -s

# git clone https://github.com/phalcon/cphalcon

# cd cphalcon/

# git checkout tags/v3.4.4 ./

# zephir fullclean

# zephir build


But it had to be done:


\$ sudo -s

# git clone https://github.com/phalcon/cphalcon

# cd cphalcon/

# git checkout tags/v3.4.4 ./

# cd build

# ./install


If you need version 4.0.0, then we must do as is written in the manual for 4.0.0, a little tweak version


\$ sudo -s

# git clone https://github.com/phalcon/cphalcon

# cd cphalcon/

# git checkout tags/v4.0.0-beta.1 ./

# zephir fullclean

# zephir build


And also, it was necessary to increase the swap file from default 100 MB to at least 2000 MB. Because, the compiler lacks RAM. 1 GB.

\$ sudo -s

# nano /etc/dphys-swapfile

Replacing CONF_SWAPSIZE=100 with CONF_SWAPSIZE=2000


And having saved the setting, we reboot the daemon:


# /etc/init.d/dphys-swapfile stop

# /etc/init.d/dphys-swapfile start



10.1k

Thnx for adding this solution.