wp-cli / eval-command

Executes arbitrary PHP code or files.
MIT License
8 stars 15 forks source link

Error: 'example.php' does not exist. #43

Closed shillshocked closed 4 years ago

shillshocked commented 4 years ago

echo '<?php echo is_wp_error("foo") ? 1 : 0;' > example.php wp eval-file example.php Error: 'example.php' does not exist.

schlessera commented 4 years ago

I cannot replicate the above problem, it is likely a problem with your environment, not with WP-CLI itself.

GitHub issues are meant for enhancement requests and specific, reproducible bugs, not for general support questions. For support options, please review http://wp-cli.org/#support

The easiest way to get support is to join us in the #cli channel on the Make WordPress Slack Team.

shillshocked commented 4 years ago

Yes, it turned out I had to be su'd in as a particular user (the one which owned wordpress) and not root. Not sure why root couldn't find the files, it was the same location.

shillshocked commented 4 years ago

On further examination, with root you should use --allow-root