Problem when you run symfony project on OSx?

Hello!

I'm new to OSx and I have problems with 7.1 and php SPL interfaces (I think them). Every 2 or 3 requests to the Symphony project (using Apache) mistakes happen, described below.

Spl_autoloader error when trying to load the class ParameterBag:
Warning: class_implements(): Class /\.[^.]+\.twig$/ does not exist and could not be loaded


Stack trace:
1 in DebugClassLoader.php line 243
 2 at ErrorHandler->handleError('2', 'class_implements(): Class /\.[^.]+\.twig$/ does not exist and could not be loaded', '/Users/mtertishniy/sites/dvsota/vendor/symfony/symfony/src/Symfony/Component/Debug/DebugClassLoader.php', '243', array('class' => 'Symfony\Component\HttpFoundation\ParameterBag', 'file' = > '/Users/mtertishniy/sites/dvsota/vendor/composer/../symfony/symfony/src/Symfony/Component/HttpFoundation/ParameterBag.php', 'exists' => true, 'refl' => object(ReflectionClass), 'name' => 'Symfony\Component\HttpFoundation\ParameterBag', 'notice' => array(), 'len' => '8', 'ns' => 'Symfony\', 'parent' => false, 'parentInterfaces' => array('/\.[^.]+\.twig$/' => '1'), 'deprecatedInterfaces' => array(), 'interface' => '/\.[^.]+\.twig$/'))
 3 at class_implements('/\.[^.]+\.twig$/') in DebugClassLoader.php line 243
 4 at DebugClassLoader->loadClass('Symfony\Component\HttpFoundation\ParameterBag')
 At 5 spl_autoload_call('Symfony\Component\HttpFoundation\ParameterBag') in Request.php line 247


Drua strange error:
OutOfMemoryException in DebugClassLoader.php line 243:
Error: Allowed memory size of 1073741824 bytes exhausted (tried to allocate 140495632205216 bytes)


I tried achdebit this error by var_dump variables that DebugClassLoader tries to load and crashes, and found that sometimes the argument in the load method crashes incorrect line interface.
MhvAq.jpg

Tried to decode krakozyabry and polucilosi Countable.

Apache (httpd) and PHP 7.1 installed via brew.

PHP modules:
$ php -m
 [PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dba
dom
exif
fileinfo
filter
ftp
gd
gettext
hash
iconv
imagick
intl
json
ldap
libxml
mbstring
mcrypt
mysqli
mysqlnd
odbc
openssl
pcntl
pcre
PDO
pdo_mysql
PDO_ODBC
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xdebug
xml
xmldiff
xmlreader
xmlrpc
xmlwriter
xsl
yaml
zip
zlib

 [Zend Modules]
 Xdebug


How to solve this problem?
June 14th 19 at 19:18
2 answers
June 14th 19 at 19:20
Solution
I finally figured out! Problem in php. That's a bug in the official bug tracker php https://bugs.php.net/bug.php?id=74015

In short, if such behavior is present in all versions of php under 7.1 (inclusive) and will be corrected in version 7.2

PS many thanks to all who said that the problem is memory_limit, without you I would not have coped
June 14th 19 at 19:22
Php ran out of memory. Need to extend the memory_limit.
brilliant! 140 GB is not enough! Out of memory - a consequence of the fact that periodically, the autoloader tries to load curves interfaces - rossie.Glover commented on June 14th 19 at 19:25

Find more questions by tags ApachemacOSPHPSymfony