1

I have created a website and just uploaded it on a virtual host, but when I try accessing it I get the "This page isn’t working (HTTP ERROR 500)" and I got this from the error log file, I understand it is something to do with the file paths but I don't know how to fix it. does anyone know how to fix it?

[Sun Dec 20 00:18:28.000823 2020] [fcgid:warn] [pid 2449] [client 89.168.52.229:52594] mod_fcgid: stderr: PHP Warning:  require(/home/ae504/public_html/AuctionSystem/View/Template/header.phtml): failed to open stream: No such file or directory in /home/aee504/public_html/AuctionSystem/View/index.phtml on line 1
[Sun Dec 20 00:18:28.000849 2020] [fcgid:warn] [pid 2449] [client 89.168.52.229:52594] mod_fcgid: stderr: PHP Stack trace:
[Sun Dec 20 00:18:28.000853 2020] [fcgid:warn] [pid 2449] [client 89.168.52.229:52594] mod_fcgid: stderr: PHP   1. {main}() /home/aee504/public_html/AuctionSystem/index.php:0
[Sun Dec 20 00:18:28.000856 2020] [fcgid:warn] [pid 2449] [client 89.168.52.229:52594] mod_fcgid: stderr: PHP   2. require_once() /home/aee504/public_html/AuctionSystem/index.php:5
[Sun Dec 20 00:18:28.000859 2020] [fcgid:warn] [pid 2449] [client 89.168.52.229:52594] mod_fcgid: stderr: PHP Fatal error:  require(): Failed opening required '/home/ae504/public_html/AuctionSystem/View/Template/header.phtml' (include_path='.:/usr/share/php') in /home/aee504/public_html/AuctionSystem/View/index.phtml on line 1
[Sun Dec 20 00:18:28.000862 2020] [fcgid:warn] [pid 2449] [client 89.168.52.229:52594] mod_fcgid: stderr: PHP Stack trace:
[Sun Dec 20 00:18:28.000865 2020] [fcgid:warn] [pid 2449] [client 89.168.52.229:52594] mod_fcgid: stderr: PHP   1. {main}() /home/aee504/public_html/AuctionSystem/index.php:0
[Sun Dec 20 00:18:28.000868 2020] [fcgid:warn] [pid 2449] [client 89.168.52.229:52594] mod_fcgid: stderr: PHP   2. require_once() /home/aee504/public_html/AuctionSystem/index.php:5
André Walker
  • 588
  • 10
  • 30
fria
  • 11
  • 4
  • Can you please show the code that causes the error? – El_Vanja Dec 20 '20 at 00:27
  • @El_Vanja – fria Dec 20 '20 at 00:29
  • seems like you are using the full path to access your files. you should use a relative path. This files are in a different location in server. – André Walker Dec 20 '20 at 00:44
  • how do i write the relative file name, would be like this /././././View/Template/header.phtml? – fria Dec 20 '20 at 00:47
  • Relative means compared to the current folder. So if your `index.php` is already in `View`, the relative path would be `Template/header.phtml`, as that is what you would have to add to your current location to reach the file. – El_Vanja Dec 20 '20 at 00:50
  • i looked again and you are trying to access `Template/header.phtml` from `index.phtml`. and the full path seems correct: `/home/aee504/public_html/AuctionSystem`. Please check if your file exists and if you have the correct access. – André Walker Dec 20 '20 at 00:53
  • I just changed it to /Template/Header.phtml and still getting the same error – fria Dec 20 '20 at 00:55
  • @fria the path wasn't the problem. Check if the file Template/header.phtml exists and if you have the correct access to him. – André Walker Dec 20 '20 at 00:59
  • Does this answer your question? [PHP Fatal Error Failed opening required File](https://stackoverflow.com/questions/5364233/php-fatal-error-failed-opening-required-file) – André Walker Dec 20 '20 at 01:01
  • yes it exists and the file permission is set to 664 – fria Dec 20 '20 at 01:02
  • you can always `var_dump(getcwd()); exit;` to get the current working directory you are sitting in, then you can figure out the relative path from there – delboy1978uk Dec 20 '20 at 01:12

1 Answers1

0

/home/ae504/public_html/AuctionSystem/View/Template/header.phtml

The file doesn't exist or is not readable. Simple *nix error

Either your templating engine is not producing it, or it is being produced but not readable. Given your error report, there is no way of telling. Suggest you go look at whatever framework you are using.

  • it works perfectly fine when i use local host on phpstorm but then it stops working on when i upload it on the host – fria Dec 20 '20 at 01:22