-1

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.

2
  • how about file permissions ? Commented Jun 2, 2015 at 20:24
  • Can you open a command prompt and type: "php index.php" ? Commented Jun 2, 2015 at 20:25

3 Answers 3

1

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
Sign up to request clarification or add additional context in comments.

7 Comments

that works, but as soon as theres html in the .php file. it stops working
Try to make an easier page that just prints "Hello world" and try to include that and see if it works. Could it be a problem with your code?
i have echo'd out a word succesfully but the html stops it from working as soon as there's some.
What does that mean? Can you be a bit more detailed about your problem, maybe post some code?
i have added more lines to the post. I added the error log, to me it doesnt really say much besides my badly coded line. i have tried running my website off xampp locally. only thing its throwing is error logs(my sql password login is wrong.[i did not change the password]) but its still not showing my web content.
|
0

I didnt close a {} so it caused the rest of the codes to not work./...

Comments

-2

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.

4 Comments

When i call a php file with php_include. it decides to ignore everything from that line downwards.
Could you post the code of Template_pageTop.php or at least include only one file (with echo "Hello World"; on it) to be sure it is not from the included files?
gyazo.com/9fb0d56aefefed99c053f1366ee4aae2 keep in mind style sheet is called upon index.php and content are all loaded into pageMiddle via .load
i have found out that my website works fine with xamp apache on local computer. but doesnt work when its uploaded to my server. the php includes just wont run

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.