0

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?

Update

(I removed the update, as it did not have any connection to the fix for this issue)

2 Answers 2

1

These are the commands that I used to install the latest Phalcon 5.0.0RC3:

cd /usr/local/lib
git clone -b 5.0.x https://github.com/phalcon/cphalcon
cd cphalcon
zephir fullclean
zephir build
phpenmod phalcon

Do keep in mind that Phalcon five is still a release candidate and has not been finalized yet. The Phalcon team hopes to have the final release out by the end of August.

3
  • I see, I tried following your steps, but still get the same error. I only chose Phalcon 5 because I have php 8.1 installed. I am not exactly in a hurry, do you recommend I wait for their finalized version? Commented Aug 4, 2022 at 5:10
  • 1
    You don't need to wait if you are getting up and running on Phalcon and don't need to put your code live in production right now. For example, I have four products in Phalcon and I am migrating three of them now to Phalcon 5, so testing with the release candidate of Phalcon 5 if acceptable to me. Commented Aug 5, 2022 at 12:17
  • Alright, I will try to see what is causing this error. I'll update the question if I find anything new :) Commented Aug 8, 2022 at 7:37
0

fix

I tried the following steps, and it worked!

  1. I downloaded the repo from here (cloning the repo will probably work fine too): https://github.com/phalcon/cphalcon/releases/tag/v5.0.0RC4
  2. I ran the following (note that zephir compile will take a long time):
cd cphalcon/
zephir fullclean
zephir compile
cd ext
phpize
./configure
make && make install
cd ..
zephir install
  1. And added the extension="phalcon.so" inside the php.ini file.
  2. I restarted the webserver:
sudo apachectl restart
  1. 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).
But this might be more of a way to avoid the issue rather than fixing it...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.