WordPress Outside of WordPress Not Executing
-
I’m having some trouble including WordPress from outside itself via command line.
When visiting
hello.phpin the browser, it works just fine; however, when executed via command line,php5 /var/project1/hello.php, nothing happens.hello.phpcontains only the following code:` <?php
require(‘/var/project2/wp-load.php’);
echo “hello world”;
?>`When I delete
require('var/project2/wp-load.php');from the code, and execute via command line, it correctly displayshello world.I checked permissions, which are fine (unless I’m mistaken). There aren’t any errors in nginx or php5-fpm. Requiring
wp-blog-header.phpinstead ofwp-load.phphas the same effect.I’m completely stumped as to how to make
php5 /var/project1/hello.phpcorrectly execute.
The topic ‘WordPress Outside of WordPress Not Executing’ is closed to new replies.