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

Setup on Windows Problem #12

Closed
oleteacher opened this issue Dec 21, 2018 · 8 comments
Closed

Setup on Windows Problem #12

oleteacher opened this issue Dec 21, 2018 · 8 comments

Comments

@oleteacher
Copy link

Greetings, awesome project! Have been wanting to learn more about electron, especially with PHP.

I have installed using GIT and can start (npm start) but showing "PHP server not started. Retrying..."

Running Windows 10. Here is my config:

const PHPServer = require('php-server-manager');

const server = new PHPServer({
    port: 5555,
	directory: __dirname,
    directives: {
		display_errors: 0,
        expose_php: 0
    }
});

server.run();

Sure it is something I do not understand about configuring main.js

Could you give me example of what you have working for Windows?

Thanks!

@aj-techsoul
Copy link
Owner

aj-techsoul commented Dec 21, 2018 via email

@oleteacher
Copy link
Author

I did a restart and still have issue. Little more info shown:

PHP Server error { Error: spawn php ENOENT
    at exports._errnoException (util.js:1024:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:192:19)
    at onErrorNT (internal/child_process.js:374:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:607:11)
    at startup (bootstrap_node.js:167:16)
    at bootstrap_node.js:589:3
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn php',
  path: 'php',
  spawnargs:
   [ '-S',
     '127.0.0.1:5555',
     '-t',
     'F:\\Electron\\ELECTRON-4-PHP',
     '-d',
     'display_errors=0',
     '-d',
     'expose_php=0' ] }
PHP Server closed

Never had directory permission issues or have to run as admin before, but will try those things later. Will also try on different computer this evening.

So I understand "otherwise downgrade the UAC to zero", where is this setting?

Thanks!

@oleteacher
Copy link
Author

oleteacher commented Dec 21, 2018

Maybe I am not understanding where PHP should be on drive.

I see a "php" folder within the ELECTRON-4-PHP folder and would assume, there is no need for PHP to be installed on every machine before using app?

@aj-techsoul
Copy link
Owner

screen shot 2018-12-23 at 11 23 55 am

i think you have downloaded the general one, download from here the separate for windows
https://github.com/AJ-TechSoul/ELECTRON-4-PHP/tree/Electron-4-PHP-Windows

Actually both has only one difference, For Windows i have put PHP in it. And for general or other OS they come by cmd-line. So go on try this and let me know.

Another thing To turn off UAC:
Click the Start menu. In the search field type UAC.
Click "Change User Account Control settings."
In the window that comes up, move the slider down to "Never Notify."
Click OK and then restart the computer.

That will work great, actually for Linux and Mac we have Root Access which prompts when application needs to run as root. But in Windows they tried to make something like that which sometimes annoying because they don't prompt but directly stops it.

Do let me know does this help, if not tell me what you facing again.
If suppose after all it doesn't work then double click on "setenv.bat" file which will do the necessary changes in your environment.
Thanks for letting me know the problems you all facing so that i could fix or guide you for the same :)

@juppwerner
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
Joachim

@aj-techsoul
Copy link
Owner

@juppwerner hmm does it resolve the issue. If yes then i will add this is master file too. Thanks man to support in it.
:)

@aj-techsoul
Copy link
Owner

I have added the changes you said. @juppwerner

@aj-techsoul
Copy link
Owner

@juppwerner I have updated the Windows branch also. Kindly check in the Branch.
https://github.com/AJ-TechSoul/ELECTRON-4-PHP/tree/Electron-4-PHP-Windows

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

3 participants