I am using PhpStorm 2018.2.1 on Windows 10.
I have Homestead Vagrant box setup for Laravel. My Laravel application is working as expected. Recently I have configured Xdebug for my PHP 7.1 and configured PhpStorm according to this article but when I am starting to debug I am getting the following error:
vagrant://C:/Users/Suman/Homestead/usr/bin/php -dxdebug.remote_enable=1 -dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=10.0.2.2 /home/vagrant/Code/news/app/Http/Controllers/HomeController.php
PHP Fatal error: Class 'App\Http\Controllers\Controller' not found in /home/vagrant/Code/news/app/Http/Controllers/HomeController.php on line 8
PHP Stack trace:
PHP 1. {main}() /home/vagrant/Code/news/app/Http/Controllers/HomeController.php:0
Fatal error: Class 'App\Http\Controllers\Controller' not found in /home/vagrant/Code/news/app/Http/Controllers/HomeController.php on line 8
Call Stack:
0.1118 383032 1. {main}() /home/vagrant/Code/news/app/Http/Controllers/HomeController.php:0
Process finished with exit code 255
I don't know how to proceed from here. What could be the problem?
Looks like you have a configuration issue. It appears you are attempting to run your vagrant php scripts through your windows php interpreter?
vagrant://C:/Users/Suman/Homestead/usr/bin/php -dxdebug.remote_enable=1 -
dxdebug.remote_mode=req -dxdebug.remote_port=9000 -dxdebug.remote_host=10.0.2.2
/home/vagrant/Code/news/app/Http/Controllers/HomeController.php
Note that it is calling the interpreter here: c:/users/Suman/Homestead/usr/bin/php but it is looking for a your controllers on the vagrant box '/home/vagrant/Code/news/app/Http/Controllers/HomeController.php
Although the files will be on your windows drive and you will mount them to your vagrant instance upon boot, all the work should be happening on the vagrant box itself. Phpstorm will edit the files through the windows machine, but the running and debugging will occur in the vagrant instance (in the mounted folder).
Related
When I attempt to run a PHP file containing mysqli functions through command line it throws an error like Fatal error: Uncaught Error: Call to undefined function mysqli_connect()
The same file runs perfectly through the built-in web station app so naturally, I tried running it with the -c parameter and specifying the same file that PHP is run with through the web station app:
php -c /usr/local/etc/php73/cli/php.ini /volume1/web/test.php
But I still get the same error so I am at a loss as to what the issue could be here
Synology Diskstation has a concept of packages. PHP packages are installed with a specific version number. When you want to use the same setup that you have in Web Station you must use the appropriate PHP version.
If you are using PHP 7.3 package then try executing it with php73
php73 /volume1/web/test.php
When I attempt to run a PHP file containing mysqli functions through command line it throws an error like Fatal error: Uncaught Error: Call to undefined function mysqli_connect()
The same file runs perfectly through the built-in web station app so naturally, I tried running it with the -c parameter and specifying the same file that PHP is run with through the web station app:
php -c /usr/local/etc/php73/cli/php.ini /volume1/web/test.php
But I still get the same error so I am at a loss as to what the issue could be here
Synology Diskstation has a concept of packages. PHP packages are installed with a specific version number. When you want to use the same setup that you have in Web Station you must use the appropriate PHP version.
If you are using PHP 7.3 package then try executing it with php73
php73 /volume1/web/test.php
I'm currently working on an api which has been developed using Lumen 5.4. I'm trying to run this on my local XAMPP for Linux 7.4.3. But I keep getting the following error,
lumen.ERROR:
Symfony\Component\Debug\Exception\FatalThrowableError:
Call to undefined function xxx\Prometheus\Storage\apcu_add() in
/opt/lampp/htdocs/xxx-api/vendor/xxx/php-prometheus-exporter/src/Storage/APCU.php:78
Current PHP version is 7.4.3. I have installed apcu along with apcu_bc and added the following to php.ini as well,
extension=apc.so
apc.enabled="1"
but I'm not seeing any apc related info in phpinfo.php page.
Any help is appreciated.
I am working on a web application project with Laravel 5.4.21, PHP 7 and Apache 2.4 on Windows 10.
When I run Laravel using 'php artisan serve' command, it runs fine. But if I run from apache htdocs, it shows following errors:
FatalThrowableError in Encrypter.php line 130: Call to undefined function openssl_decrypt()
But I have OpenSSL enabled in php.ini.
I do not have Xampp. I have searched some solutions, but they do not work.
I am trying to install MongoDb on windows platform. I'm using PHP with WampServer.
But while executing the PHP program it gives the following error:
Fatal error: Class 'Mongo' not found in C:\wamp\www\test\index.php on line 19
So is there any way to check whether MongoDB is running with PHP or not ?
Please check php loaded extensions using phpinfo() function whether mongoDB extension is loaded or not.
Do check these as well.
Fatal Error - 'Mongo' class not found
Fatal error: Class 'Mongo' not found in xampp
Add the following line to your php.ini file:
extension=php_mongo.dll
Docs Link: http://php.net/manual/en/mongo.installation.php
Check this possible solution
Copy c:\wamp\bin\php\php-5.3.x\ext\
Edit c:\wamp\bin\apache\Apache2.2.xx\bin\php.ini and add the line where the extensions are loaded.
Why run WAMP on 32bit Windows 7 64bit?
The Mongo PHP driver does not have a 64bit binary win32, if you are running the 64bit version of WAMP, PHP will refuse to load the 32-bit version of php_mongo.dll.