0
votes

I am developing a node app with node-webkit. I need to use php badly in my application..So i need to know wheather i can use php in my application.I came to know that using php-webkit we can use it.But i am not able to do it. Please help me to impliment the php-webkit and express into node-webkit. i need to know how to install express and php-webkit.

This is my package.json

{
  "name": "ncubicx",
  "version": "1.0.0",
  "description": "",
  "main": "application/index.php",
  "scripts": {
  "test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"window": {
"toolbar": false,
"width": 800,
"height": 500
},
"node-remote": "<local>",
"phpwebkit": {
    "bin": "",
    "path": "./application",
    "host": "localhost",
    "port": 9090
},
"license": "ISC",
"dependencies": {
  "express":"4.*.*"
}
}
2
What do you need to use php for? Can it be done with node? - Vaviloff
nope..it cannot be done with node...i have an existing php application which i need to make it into node desktop application - Ninoop p george

2 Answers

2
votes

It seems you're using this php-webkit boilerplate project.

To get it working you have to

  1. Download a nw.js build for your platform from http://nwjs.io/ and unpack it in a folder, say, php-webkit.

  2. If php binaries folder is on PATH on your machine, skip this step. Otherwise put php binaries into php-webkit/bin/php folder. On Windows those are php-cgi.exe and php5ts.dll.

  3. In terminal go to php-webkit folder and run command "npm init" to install node modules that php-webkit is dependent on.

  4. Then you can launch your nw application and observe php_info() function output (by default).

  5. PHP files are to be put into php-webkit/application folder. Consider that folder the document root.

1
votes

you can try to set up a local php-enabled server, (but i don't know how to do so), and then set "main": "http://localhost/index.php" in your node-webkit package.json