• 10
name

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191

Backtrace:

File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

PHP Artisan Tinker crashing from any command

I haven't had this problem before, but my php artisan tinker crashes from issuing any command - and leaves no logs whatsoever on what is causing the crash.

project4 $ php artisan tinker
Psy Shell v0.9.9 (PHP 7.3.0 — cli) by Justin Hileman
>>> use \App\Jobs\testJob;
project4 $

or even the simplest command:

project4 $ php artisan tinker
Psy Shell v0.9.9 (PHP 7.3.0 — cli) by Justin Hileman
>>> print("Hello World!");
project4 $

I almost wonder if it isn't connecting to PHP correctly, but I can't find any logs anywhere. Laravel has no trace of the commands. I ran brew update, but no difference. For the record, all of my projects are affected. I can't tinker on any of my projects. Help!

I did recently upgrade to PHP 7.3.0, which is working fine in every other area. Hmm...

If you are using PHP 7.3 installed by homebrew on Mojave, try creating a config file at ~/.config/psysh/config.php if not already there:

<?php
return [
  'usePcntl' => false,
]; 

Source: https://github.com/bobthecow/psysh/issues/540#issuecomment-446480753

  • 102
Reply Report

This happens on Mojave when you upgrade/install PHP 7.3 using homebrew, (It's a problem with PsySh (used by Tinker) and Homebrew's PHP 7.3.0 build.)

Simple solution is, In your php.ini set

pcre.jit=0


If you don't know which ini file is used, you can run php --ini to find it,

# /usr/local/etc/php/7.3/php.ini
- ;pcre.jit=1
+ pcre.jit=0
  • 8
Reply Report

I'd recommend to install a previous version of PHP via brew, if you have PHP 7.3 just a take a step back and install 7.2

brew install php@7.2

It worked for me, hope does it for you too.

  • -2
Reply Report

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags

Related Questions