apache2 not loading php codes
This index.php file worked fine until recently. my server is running ubuntu 15.04
i have tried complete reinstalling php5 and apache2 package.
My index.php: http://gyazo.com/26fe168e7bf0695233f61d7d1eb29b47
instead of running the include_once code it totally ignores it...
what view source from website shows: http://gyazo.com/09606d26de4fd9002eb3265def95f52c
help?? :(
update: everything works fine in dreamweaver like it supposed to. I think its the serverside problem. I have not altered anything that could cause this screw up >.>
error log
pastebin.com/uZCKUxYh
HTML works fine by its self. php echo works. but my php_includes is causing all the problems
when i add a / into file location (php include_once("/filename.php")) it decides to: gyazo.com/9b530bc9383ab9be534b41e639920f0f but doesnt show or run the php codes.
I assume that if you make a simple "Hello World" PHP page the output is empty, right?
<?php
echo "Hello world!";
?>
Does any error message appears? Has the server actually ever printed anything like a phpinfo(), for example?
You could try to restart apache with the following command:
sudo systemctl restart apache2
我没有关闭{},因此导致其余代码无法正常工作。/ ...
When you view the sources from your browser you will only see HTML, it is because the server will only return a HTML code.
Is the extension ".php" otherwise it will be treated as a normal HTML page and everything else will be ignored.
If it is a php page, could you post the content of the included files? what do you expect to see?
Edit: after reading the error logs. From the error logs you posted, you get a lot of file not found errors like :"include_once(): Failed opening '/php_includes/check_login_status.php' for inclusion (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/html/index.php on line 13" which is a problem of path. You may try the answer in this question it tells how to include files the correct way.
链接地址: http://www.djcxy.com/p/69270.html下一篇: apache2不加载php代码