cphalcon
cphalcon copied to clipboard
Zephir build throws "exhausted allowed memory size" on newly cloned Phalcon repo
General
software: MacOS
Phalcon: 5.0.x
PHP: 8.1
Zephir: 0.16.0
brew: [email protected]
Location: ~/Documents/cphalcon
Details
I have just cloned phalcon following the instructions here. I have already installed zhephir_phar and set up zephir.phar to make it executable. Then I cloned the repo and ran these:
cd cphalcon/
git checkout tags/v5.0.0 ./
zephir fullclean
zephir build
However the second command throws
error: pathspec 'tags/v5.0.0' did not match any file(s) known to git
(and there is indeed no folder named tags)
As for the fourth command, (zephir build
) throws:
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32768 bytes) in phar:///usr/local/bin/zephir/Library/Statements/ForStatement.php on line 631
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32768 bytes) in phar:///usr/local/bin/zephir/Library/Statements/ForStatement.php on line 631
This is a newly cloned repo, and I have not yet changed anything. Any clues as to what is throwing this error?
(also, was I supposed to write this as a discussion and not as an issue?)
more details
https://stackoverflow.com/questions/73230236/zephir-build-throws-exhausted-allowed-memory-size-on-newly-cloned-phalcon-repo
Try theses zephir commands:
zephir fullclean
zephir generate
zephir compile
Thanks! but I still got the same error on zephir generate
.
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in phar:///usr/local/bin/zephir/Library/Parser/Parser.php on line 71
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 20480 bytes) in phar:///usr/local/bin/zephir/Library/Parser/Parser.php on line 71
As for zephir compile
it works, and then gets stuck at Compiling...
(is this the expected behavior?)
configure.ac:161: the top level
Preparing configuration file...
Compiling...
I also noticed that I had to run
git checkout tags/v5.0.0beta3 ./
and not
git checkout tags/v5.0.0 ./
since it is not out yet, so I tried it.
But afterwards, when I tried zephir fullclean
it gave me:
Could not load extension(s): psr. You must load extensions above before build this extension.
But psr should be installed, when I tried running brew install psr
I got:
Warning: phalcon/extension/psr@74 0.7.0 is already installed and up-to-date.
To reinstall 0.7.0, run:
brew reinstall psr@74
You are using old tag tags/v5.0.0beta3
, please use v5.0.0RC4
Could not load extension(s): psr. You must load extensions above before build this extension.
PSR is not required since RCx releases.
Thanks, I tried these:
% git checkout tags/v5.0.0RC4 ./
error: pathspec 'tags/v5.0.0RC4' did not match any file(s) known to git
% git checkout v5.0.0RC4 ./
error: pathspec 'v5.0.0RC4' did not match any file(s) known to git
How should I write the command for v5.0.0RC4
?
fix
I tried the following steps, and it worked!
- I downloaded the repo from here: https://github.com/phalcon/cphalcon/releases/tag/v5.0.0RC4
- I ran the following:
cd cphalcon/
zephir fullclean
zephir compile
cd ext
phpize
./configure
make && make install
cd ..
zephir install
- And added the
extension="phalcon.so"
inside the php.ini file. - I restarted the webserver:
sudo apachectl restart
- Finally I created the files
public/index.php
and.htrouter.php
as instructed here, and started the webserver:
$(which php) -S localhost:8000 -t public .htrouter.php
more
It seems the only issue was with zephir generate
. The framework seemed to work perfectly fine so long ad I skipped that command (zephir build
ran zephir generate
as well).
Should this issue be closed as I managed to find a solution for it, or should it be kept open because I only managed to avoid the issue?
Issue can be closed. Closing.