Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP SERVER NOT STARTED. RETRYING... #26

Open
sheerazahmadpk opened this issue Nov 8, 2020 · 14 comments
Open

PHP SERVER NOT STARTED. RETRYING... #26

sheerazahmadpk opened this issue Nov 8, 2020 · 14 comments

Comments

@sheerazahmadpk
Copy link

I just use this repo but I am getting this error
PHP SERVER NOT STARTED: RETRYING...

electron

and output is showing raw php file

@aj-techsoul
Copy link
Owner

aj-techsoul commented Nov 8, 2020 via email

@sheerazahmadpk
Copy link
Author

I follow your steps but I am getting same error

@Rajeshwaran2001
Copy link

I just use this repo but I am getting this error
PHP SERVER NOT STARTED: RETRYING...
I had the file in c drive only

Screenshot (69)

@aj-techsoul
Copy link
Owner

aj-techsoul commented Nov 20, 2020 via email

@Rajeshwaran2001
Copy link

Hi,

I had the same issue.

I have installed the xampp package, and I had C:\xampp\php in my PATH environment variable.
So the phpinfo() here always showed the PHP installed with xampp.

I removed C:\xampp\php from my PATH in order to see the PHP info which came with the ELECTRON-4-PHP git package. Then it showed

PHP server not started. Retrying...
It works when you change main.js to add the path to the bundled PHP like this:

const server = new PHPServer({
php: "php\php.exe", // <==== ADDED
port: 5555,
directory: __dirname,
directives: {
display_errors: 1,
expose_php: 1
}
});
Perhaps this should just be added to the README file?

Regards
Rajeshwaran

@aj-techsoul
Copy link
Owner

aj-techsoul commented Nov 21, 2020 via email

@johnhart96
Copy link

Did anyone else find a valid solution to this problem other than just saying "please run the .bat file".
I have this working fine on macos, but it fails on windows. I think this might have something to do with PHP being distributed with windows.

@Teyk0o
Copy link

Teyk0o commented Sep 6, 2022

Hi,

I had the same issue.

I have installed the xampp package, and I had C:\xampp\php in my PATH environment variable. So the phpinfo() here always showed the PHP installed with xampp.

I removed C:\xampp\php from my PATH in order to see the PHP info which came with the ELECTRON-4-PHP git package. Then it showed

PHP server not started. Retrying... It works when you change main.js to add the path to the bundled PHP like this:

const server = new PHPServer({ php: "php\php.exe", // <==== ADDED port: 5555, directory: __dirname, directives: { display_errors: 1, expose_php: 1 } }); Perhaps this should just be added to the README file?

Regards Rajeshwaran

This is the solution, thanks !

@Henry-Turtle
Copy link

I'm using Laravel with this repo, and was getting the same issue. My code in main.js (lines 68-87):
server = new PHPServer({
php: "${__dirname}/php/php.exe", //Quotation marks there are acually backticks, but Github didn't like it
port: 5555,
directory: __dirname,
directives: {
display_errors: 1,
expose_php: 1
} }
); }

(Github didn't let me format this code for some reason, sorry)

When I ran this, I got one "PHP server not started. Retrying..." message, then it opened up my app and gave me this message:
Parse error: syntax error, unexpected '=' in C:\Users\thegr\Desktop\ELECTRON-4-PHP\Scouting-Program\vendor\symfony\string\Resources\functions.php on line 34
When I looked up this issue, I came across a stackoverflow post that said the error was caused by a Null Coalescing Assignment Operator, which was introduced in php 7.4. Taking a peek in the bundled php installation, I saw that it was version 7.2, so I deleted the installation and reinstalled my own at current version. I had to uncomment a few extensions, (I just copied my personal php.ini file contents), and renamed the php.ini-development to php.ini (for some reason it wasn't loading otherwise), and my app loaded and worked as intended! Hopefully others find this helpful, even though its a little off topic for the thread

@Poreis
Copy link

Poreis commented Feb 27, 2023

I'm still getting this issue...
I'm using MacOS and I get this error :

PHP Server error Error: spawn php ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn php',
  path: 'php',
  spawnargs: [
    '-S',
    '127.0.0.1:5555',
    '-t',
    '/Users/pedrogouveia/ELECTRON-4-PHP',
    '-d',
    'display_errors=1',
    '-d',
    'expose_php=1'
  ]
}
PHP Server closed
PHP server not started. Retrying...

Maybe this should be fixed.

@aj-techsoul
Copy link
Owner

aj-techsoul commented Feb 28, 2023 via email

@Poreis
Copy link

Poreis commented Feb 28, 2023

Dear AJ,

I'm running the program on my mac, and when I run the "sudo npm start" it gives me this error:

PHP Server error Error: spawn php ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn php',
  path: 'php',
  spawnargs: [
    '-S',
    '127.0.0.1:5555',
    '-t',
    '/Users/pedrogouveia/Documents/Projectos/phptest/ELECTRON-4-PHP',
    '-d',
    'display_errors=1',
    '-d',
    'expose_php=1'
  ]
}
PHP Server closed
PHP server not started. Retrying...

I'm I suppose to have PHP installed? Because in main.js you don't have any path for php if not running in windows. I'm running this command in "sudo". Any idea on why I might be having this issue?

@Poreis
Copy link

Poreis commented Feb 28, 2023

Solved the issue by installing PHP on macOS.

@aj-techsoul
Copy link
Owner

aj-techsoul commented Mar 6, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants