Comments (6)
Looks it doesn't find the router. Keep in mind that base
is resolved relatively to the Gruntfile, not the current directory. Run this from the directory of your Gruntfile and make sure the ouput is the path to your router: $ node -e 'console.log(require("path").resolve("../../../.."))'
.
from grunt-php.
I've cd'ed to the GruntFile and ran the command you specified, but it threw an error. I was running it in PowerShell so I tried cmd. On cmd it does not output anything.
PS C:\Users\connelhooley> cd .\Documents\Web\connelhooley\wp-content\themes\connelhooley\dev\
PS C:\Users\connelhooley\Documents\Web\connelhooley\wp-content\themes\connelhooley\dev> ls
Directory: C:\Users\connelhooley\Documents\Web\connelhooley\wp-content\themes\connelhooley\dev
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 07/08/2015 22:11 .sass-cache
d----- 09/08/2015 16:09 dist
d----- 07/08/2015 22:25 node_modules
d----- 09/08/2015 16:09 temp
-a---- 08/08/2015 00:57 39 .bowerrc
-a---- 07/08/2015 20:22 92 .ftppass
-a---- 08/08/2015 00:57 47 .gitignore
-a---- 09/08/2015 20:07 696 bower.json
-a---- 09/08/2015 20:06 7543 Gruntfile.js
-a---- 08/08/2015 00:57 973 package.json
-a---- 10/08/2015 10:48 10 router.php
PS C:\Users\connelhooley\Documents\Web\connelhooley\wp-content\themes\connelhooley\dev> node -e 'console.log(require("path").resolve("../../../.."))'
[eval]:1
console.log(require(path).resolve(../../../..))
^
SyntaxError: Unexpected token .
at Object.<anonymous> ([eval]-wrapper:6:22)
at Module._compile (module.js:456:26)
at evalScript (node.js:536:25)
at startup (node.js:80:7)
at node.js:906:3
It's worth noting that the router file is kept in the same folder as the GruntFile. Does this task expect the router to be in the base path? The php command looks in the current directory for the router (I ran it from the same directory as the GruntFile) and can find it.
Thanks
from grunt-php.
Just got the command to work by escaping the double quotes. Works as expected and returns the path to the WordPress folder I want to serve:
PS C:\Users\connelhooley\Documents\Web\connelhooley\wp-content\themes\connelhooley\dev> node -e 'console.log(require(\"path\").resolve(\"../../../..\"))'
C:\Users\connelhooley\Documents\Web\connelhooley
from grunt-php.
I have two potential fixes. Can you try them both and let me know if any of them works?
from grunt-php.
I can confirm b934191 fixes the issue for me. Sorry about the late reply.
Thanks!
from grunt-php.
I had the same issue and reverted to 1.5.0 and it worked fine. There's something weird with the base & router setting combination with the 1.5.1 fix. My 1.5.0 settings...
php: {
dev: {
options: {
hostname: 'localhost',
port: 8889,
base: 'cms/public', // Project root
keepalive: false,
open: false,
router:'router.php',
env: {
DATABASE_HOST: 'localhost',
DATABASE_USER: '*',
DATABASE_PASS: '*',
DATABASE_NAME: '*',
}
}
}
},
from grunt-php.
Related Issues (20)
- Add middleware options HOT 6
- watch livereload task works slow HOT 1
- Suppress loaded resources in shell? HOT 4
- KeepAlive: false HOT 1
- Problem running grunt-php in windows. HOT 1
- Here's how to setup this plugin with livereload HOT 1
- How can I specify which browser should be used with the 'open' parameter? HOT 7
- Couldn't find the PHP binary HOT 1
- hi can i use it with yeoman webapp generator?!! HOT 1
- Ability to add environment variables HOT 2
- Directory not found HOT 9
- how can I set a variables in *.php HOT 3
- Build failing HOT 1
- mysqli class not found HOT 1
- how to: server config, .htaccess, 404 page file, etc. HOT 2
- Fatal error: Cannot set property 'build' of null HOT 1
- Checking if the grunt-php server is running HOT 1
- Is there a way to use HTTPS out of the box? HOT 1
- Rewrite rules HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grunt-php.