Symfony 3.3 Built-In server issue (PHP 7.1.9) - php

I'm just beginning with Symfony 3 but I'm stuck with a built-in server issue.
I am using wamp64 v3.0.6 with PHP 7.1.9 (and PHPStorm as IDE) on Windows 7.
I ran the built-in server once and got a response from localhost:8000 correctly but then, just like [this issue][1], I get the following error message when I try to access localhost:8000 on subsequent tries :
Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0
Fatal error: Unknown: Failed opening required'C:\wamp64\www\projectname\vendor\symfony\symfony\src\Symfony\Bundle\WebServerBundle/Resources/router.php' (include_path='.;C:\php\pear') in Unknown on line 0
I've tried uninstalling symfony, wamp64 and PHPstorm to try to identify the problem.
After reinstalling wamp (without running the server) and symfony I've noticed the following :
When I run the built-in server for the first time and immediately access localhost:8000, it works fine. But then the server stops without my pressing CTRL-C. When I restart the server and try to access localhost:8000 I now get said error message.
I've tried creating a another project using PHP 7.0.23 with the same results : once the server crashes, I can no longer load my project.
I'm hoping someone can provide an answer as regarding this issue. I've spent the past few hours searching the web for an answer and have found none.
Thanks in advance.

Credit goes to Baig for this answer :
The source of the issue lies with the antivirus. To solve this, I've excluded the wamp directory (where symfony and my projects are also stored) from my antivirus and, voila, no more server crashes, everything works fine.

Related

FASTCGI process has failed frequently recently. Try the request again in a while

We have setup a Wordpress Website on IIS 10 which was working fine. But suddenly it stops working and i got this error
"FASTCGI process has failed frequently recently. Try the request again
in a while"
Restarting IIS fixed this problem.
Anybody tell me why this issue has occurred and how we can fix this ?
Thanks
Open command prompt as administrator and navigate to the php-cgi.exe
folder.
Execute any PHP file from your application to know the exact error. In my case, I created a simple phpinfo.php page and executed
following command.
C:\Program Files (x86)\PHP\v7.4.5>php-cgi.exe E:\Websites\mysite\phpinfo.php
It showed me the exact error saying 'vcruntime140.dll is not
compatible with this PHP build' & I have updated to 'Microsoft Visual C++ Redistributable for Visual Studio 2019'. You can download it from here.
Once you identified and resolved the error(point 3), you need to restart IIS server and run your website. It will work as expected.
If you're running PHP 8 turn track_errors Off in php.ini . Track_errors have been deprecated since 7.2 and can cause a fatal error in IIS
Finally, i found the solution to the issue, It is due to the low value given to "Rapid Fails PerMinute" - see above image posted by German Martin.
From Microsoft's website the default value for "Rapid Fails PerMinute" is 90 but i reduced it 10 and then the error "FASTCGI process has failed frequently recently...." started showing up.
Once i set it back to the default value of 90 , the error stopped. This is what worked for me, in my case.
You need to maximize "Instance MaxRequest" at FASTCGI Configuration. Just clic en IIS root -> FastCGI Settings, select you php-cgi.exe for WP and clic Edit. Then increise Instance MaxRequests
[IIS FastCGI Settings]

How to run a Laravel application that was not created by me on my personal server

I need to alter some of the front-end features of a Laravel application that was not created by me. The application was created using Laravel and am not sure how to get it up and running so I can alter the front-end code. I was given a copy of the source files. I then put that source files in to my xampp/htdocs folder. I started Xampp, opened the folder in Gitbash and entered PHP artisan serve. The application does not appear to be running.
Is there something I am missing or doing wrong? Please take into consideration that I did not create this application, for your information, I do know how to create and run a Laravel app locally, but am wondering if the process is different if it was not created by me personally?
Thank you all for helping me out, I appreciate you personally and this community.
Here is the error I am receiving in Gitbash:
PHP Warning:
require(C:\xampp\htdocs\appoets\bootstrap/../vendor/autoload.php):
failed to open stream: No such file or directory in C:\xampp\htdocs\appoets\bootstrap\autoload.php on line 17
Warning: require(C:\xampp\htdocs\appoets\bootstrap/../vendor/autoload.php):
failed to open stream: No such file or directory in
C:\xampp\htdocs\appoets\bootstrap\autoload.php on line 17
PHP Fatal error: require(): Failed opening required
'C:\xampp\htdocs\appoets\bootstrap/../vendor/autoload.php'
(include_path='C:\xampp\php\PEAR') in
C:\xampp\htdocs\appoets\bootstrap\autoload.php on line 17
Fatal error: require(): Failed opening required 'C:\xampp\htdocs\appoets\bootstrap/../vendor/autoload.php'
(include_path='C:\xampp\php\PEAR') in
C:\xampp\htdocs\appoets\bootstrap\autoload.php on line 17
Please solved this for me. If you run into the same error. Have the correct file path open in Gitbash and then run "composer install"
After that was fixed another problem popped up. I went to load Laravel in my browser and it gave a general error message no error number or anything. To fix this go to your env.example file and rename it. .env then go to the terminal or your command line and run php artisan key:generate. After this hit save all and go refresh. All should be fixed!
The errors your getting are because you haven't installed your composer dependencies. Install them with composer before running the application:
composer install
Here's the old answer before that callstack was provided. I think it's still interesting background information for you, but not immediately relevant.
It looks like you're running two web servers so I suspect you're just
confused about where the application is running.
XAMPP ships with Apache. I'd expect that running it will spin up its
web server on port 80, the default port that web browsers use.
Therefore, if you're trying to get to the application at
http://localhost, you're hitting this webserver, which might have a
different (and not set up) application on it.
Running php artisan serve will start a second web server utilizing
PHP's built in web server. According to the documentation, the
default port that this command will use is 8000:
By default the HTTP-server will listen to port 8000. However if that
port is already in use or you wish to serve multiple applications this
way, you might want to specify what port to use. Just add the --port
argument:
Therefore, you can access the application without XAMPP though this
url: http://localhost:8000
Try both URLs.
Note that php artisan serve doesn't start up a MySQL server. You
will still need XAMPP to start the MySQL server if you're using a
database.
Checklist for your issue
1. composer update --no-scripts or composer install
2. php artisan key:generate
3. rename example.env to .env
4. Change database credentials, set debug mode! Change app url
4. php artisan migrate(make sure u have the database running in the server)
5. php artisan config:clear
6. you are good to go!

can execute php file from browser but cron job get fatal error on shared server hostgator

I can execute my php scrape file by typing in the address bar:
domain.com/scrape.php
However, I try to use cron job on my shared server on host gator by this command:
/usr/bin/php-cli public_html/scrape.php
I got this error message:
Fatal error: Call to undefined function GuzzleHttp\Handler\curl_reset() in /home4/username/public_html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php on line 78
I already update my php version to stable 5.6 or even 5.7 version also same error. I think that it should not be php version error because I still can execute the file from browser right ?
Also I cannot reboot server Apache because hostgator support said they cannot reboot it until the server is totally down...
Any help please ! Thank you !
I ran into this problem last week on my own server. As it turned out, my browser was looking at one installation of PHP and cron was looking at a 2nd installation of PHP. One way to check is to run a PHP script through your browser that executes phpinfo(). That will tell you what the browser is running. Have cron do the same and save the results. Compare the two and make sure they're pointing to the same installation of PHP. Don't just check versions. Check install paths and loaded modules. Cheers.

Apache in MAMP Pro 4 has stopped working, refuses to start

Have been using MAMP Pro for a fair while - version 3 primarily, upgraded to 4 a while ago.
I haven't had any unusual issues at all, but today the Apache service failed to start, telling me to check the error logs. The logs were blank unfortunately... I've made no system configuration changes, no changes to MAMP/MAMP Pro. Shut down my system yesterday, started today, it no longer works...
I've tried numerous suggestions found via Stack Overflow and Google without any success.
Even after completely uninstalling and re-installing MAMP Pro I am unable to get the service to start.
Nothing appears in the logs...
When starting it manually on the command line it comes up with a PHP related error:
$ Applications/MAMP/bin/apache2/bin/apachectl start
httpd: Syntax error on line 135 of /Applications/MAMP/conf/apache/httpd.conf: Cannot load /Applications/MAMP/bin/php/php5.2.17/modules/libphp5.so into server: dlopen(/Applications/MAMP/bin/php/php5.2.17/modules/libphp5.so, 10): image not found
The confusing thing is that I don't have PHP 5.2.17 specified anywhere, at all - according to MAMP Pro it should be using PHP 7.0.12.
If I add PHP 5.2.17 to MAMP using the appropriate MAMP Pro dialogs, Apache still fails to start via the MAMP Pro interface. I can now start it manually from the command line however, but none of my virtual hosts/etc seem to be loaded.
apachectl -V tells me it's using /Applications/MAMP/conf/apache/httpd.conf, but there is nothing in that file that has any reference to any of the configs generated in /Library/Application Support/appsolute/MAMP PRO/conf
It also looks like hosts entries aren't added to /etc/hosts.
Even if I tell /Applications/MAMP/conf/apache/httpd.conf to do nothing but include /Library/Application Support/appsolute/MAMP PRO/conf/httpd.conf (and manually add entries to /etc/hosts) it still doesn't seem to work at all...
I and my colleagues are at a complete loss, especially given it was working yesterday...
Has anyone had any issues like this?
I managed to fix the similar issue you had.
My Apache server was working fine and then following updating to 4.0.6 I experienced similar issues.
There were 2 things I did to fix the issue. I was getting the same error where it couldn't find a php file in 5.2.17. After fixing that by adding 5.2.17 to MAMP I experienced an apache error regarding user permissions.
(22)Invalid argument: getpwuid: couldn't determine user name from uid 4294967295, you probably need to modify the User directive
File > Edit Template > Revert ALL Templates to Default Settings.
Save & restarted the servers and all worked finally and all my hosts had retained as well.
I had previously entered a custom line in my httpd.conf file that for countless versions had copied across fine however it looks like the folder structure had changed and so couldn't locate it causing the unusual error about User permissions. I have since re-entered the custom line with the correct structure and all working fine again.
Hope this helps.

Failed opening required on localhost after switching to mac

So long story short, I finally made the switch from Windows to Mac. I installed XAMPP on my new computer and have everything working. Now I am transferring local WP installs from my old computer and found this error...
Fatal error: require_once(): Failed opening required
'/Applications/XAMPP/xamppfiles/htdocs/mysite/wp-content/plugins/essential-grid//admin/includes/update.class.php'
(include_path='.:/Applications/XAMPP/xamppfiles/lib/php') in
/Applications/XAMPP/xamppfiles/htdocs/mysite/wp-content/plugins/essential-grid/essential-grid.php
on line 133
2 things. First, this isn't a problem with the plugin files themselves because they work fine on the local and live sites. Second, I highlighted where I think the error is here "essential-grid//admin", but I'm not really sure what is causing it. Is there something I need to change in my new XAMPP config?
I'm guessing it's probably a simple configuration that I'm missing. Thanks in advance.
Turns out the files got corrupted during the file transfer so this wasn't a problem with XAMPP. Everything worked out.

Categories