Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8094987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:58:28+00:00 2026-06-05T20:58:28+00:00

I want to learn and work with initialize.php so I try to build simple

  • 0

I want to learn and work with initialize.php so I try to build simple php file like index.php and just to see if it call to hello.php I got some truble on my local host using windows xp.

the details are:

http://127.0.0.1/www/oop/shape2/index.php
the file index.php

<?php
    defined('DS') ? null : define('DS', '/');
    defined('SITE_ROOT') ? null :defined('SITE_ROOT', $_SERVER['DOCUMENT_ROOT']);
    defined('LIB_PATH') ? null : define('LIB_PATH', SITE_ROOT.DS.'includes');

    echo (LIB_PATH.DS.'hello.php');
    require_once(LIB_PATH.DS.'hello.php');
?>

the output is:

SITE_ROOT/includes/hello.php

http://127.0.0.1/www/oop/shape2/includes/hello.php
the file hello.php

<?php
 echo ('hi');
 ?>

if i run it I got hi

here is my local folder on windows:
C:\Program Files\Zend\Apache2\htdocs\www\oop\shape2

what shell I do slove the problem.
Thx

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T20:58:30+00:00Added an answer on June 5, 2026 at 8:58 pm

    On the second line, you should change

    defined('SITE_ROOT') ? null :defined('SITE_ROOT', $_SERVER['DOCUMENT_ROOT']);

    to

    defined('SITE_ROOT') ? null :define('SITE_ROOT', $_SERVER['DOCUMENT_ROOT']);

    You were calling the defined function rather than the define function, meaning you never actually created the SITE_ROOT constant.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to learn windows API and PInvoke methods just like MesseageBeep in User32.dll.
I have been programming since 1999 for work and fun. I want to learn
I want to learn how calculators work. For example, say we have inputs in
I`m currently studying C++ and want to learn another language. For work I use
I want to learn C# and .net frame work properly. I read basic concept
I know PHP and MVC but when I work on Joomla I dont want
I want to learn lLinux Kernel programming. What would be the starting points for
I want to learn how to process XML with namespaces in E4X so basically
I want to learn to program in a UNIX/Linux environment. I'll be using the
I want to learn some JVM language, but there are so many EDIT :

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.