0

I am following Object oriented programming tutorial.... I did exact same as tutorial but it doesn't work for me at Url class in getPage() function and it does not show any error.

... As tutorial it will come with error.php which is in pages folder, if I don't have any page created at pages folder or that page should come that will I create at pages folder

public static function getPage() {
    $page = self::$_folder.DS.self::cPage().".php";
    $error = self::$_folder.DS."error.php";
    return is_file($page) ? $page : $error;
}

Here is my code... Have any suggestion... Thanks in advance.

Nil Sagor
  • 183
  • 1
  • 6
  • 15

1 Answers1

0

To run PHP, you need to start a server.

There are many ways to do this. One popular solution is to install mamp which has a free version.

Once you have mamp installed there will be a default htdocs directory. You can change this to where your php code is by going to preferences web server and changing document root:

Document Root Preferences

To see if any php errors have occured, you'll need to go to the logs which can be located: /Applications/MAMP/logs/php_error.log

Note: This is OS X

  • I tried at lampp and xampp both localhost and virtualhost. by in browser or in terminal error.log should show me error. but I don't get any error And I followed this tutorial [link](https://www.youtube.com/playlist?list=PLf140rGNfPsAMp4o0HmF7xMg4-sFWccYY) and I stuck in getting the right page – Nil Sagor Mar 05 '16 at 05:24
  • @NILSAGOR What command are you running in the terminal to view errors? Are you running those programs at the same time as they couldn conflict with each other. Best try to stick with one of them. –  Mar 05 '16 at 14:34