chanthalath Posted April 30, 2022 Share Posted April 30, 2022 (edited) Localhost on xampp is work. <?php defined('DS') ? null : define('DS', DIRECTORY_SEPARATOR); defined('SITE_ROOT') ? null : define ('SITE_ROOT', $_SERVER['DOCUMENT_ROOT'].DS.'job1212'); defined('LIB_PATH') ? null : define ('LIB_PATH',SITE_ROOT.DS.'include'); require_once(LIB_PATH.DS."config.php"); require_once(LIB_PATH.DS."function.php"); require_once(LIB_PATH.DS."session.php"); require_once(LIB_PATH.DS."accounts.php"); require_once(LIB_PATH.DS."autonumbers.php"); require_once(LIB_PATH.DS."companies.php"); require_once(LIB_PATH.DS."job.php"); require_once(LIB_PATH.DS."employees.php"); require_once(LIB_PATH.DS."categories.php"); require_once(LIB_PATH.DS."applicant.php"); require_once(LIB_PATH.DS."jobregistration.php"); require_once(LIB_PATH.DS."database.php"); ?> But I have run on website kkgramping.club and it's not work. <?php defined('DS') ? null : define('DS', DIRECTORY_SEPARATOR); defined('SITE_ROOT') ? null : define ('SITE_ROOT', $_SERVER['DOCUMENT_ROOT'].DS.'https://kkgramping.club/'); defined('LIB_PATH') ? null : define ('LIB_PATH',SITE_ROOT.DS.'include'); require_once(LIB_PATH.DS."config.php"); require_once(LIB_PATH.DS."function.php"); require_once(LIB_PATH.DS."session.php"); require_once(LIB_PATH.DS."accounts.php"); require_once(LIB_PATH.DS."autonumbers.php"); require_once(LIB_PATH.DS."companies.php"); require_once(LIB_PATH.DS."job.php"); require_once(LIB_PATH.DS."employees.php"); require_once(LIB_PATH.DS."categories.php"); require_once(LIB_PATH.DS."applicant.php"); require_once(LIB_PATH.DS."jobregistration.php"); require_once(LIB_PATH.DS."database.php"); ?> Please help me on this. Thank you in advance. Edited April 30, 2022 by chanthalath Quote Link to comment https://forums.phpfreaks.com/topic/314748-php-on-directory_separator-script/ Share on other sites More sharing options...
NotionCommotion Posted April 30, 2022 Share Posted April 30, 2022 What's not working? Do you have erroring enabled? If not, enable it. Also, do sanity checks such as echo('SITE_ROOT: '.SITE_ROOT); to make sure they are what you think they should be. Quote Link to comment https://forums.phpfreaks.com/topic/314748-php-on-directory_separator-script/#findComment-1595827 Share on other sites More sharing options...
chanthalath Posted April 30, 2022 Author Share Posted April 30, 2022 Yes, it's not working and enable already. I am just knowing basic in website. if you can explain more and find the solution. I will super thank you. Localhost on xampp is work. defined('SITE_ROOT') ? null : define ('SITE_ROOT', $_SERVER['DOCUMENT_ROOT'].DS.'job1212'); But website is not working. defined('SITE_ROOT') ? null : define ('SITE_ROOT', $_SERVER['DOCUMENT_ROOT'].DS.'https://kkgramping.club/'); Then, when I run and it displayed below: This page isn’t working kkgramping.club is currently unable to handle this request. HTTP ERROR 500 Quote Link to comment https://forums.phpfreaks.com/topic/314748-php-on-directory_separator-script/#findComment-1595828 Share on other sites More sharing options...
NotionCommotion Posted April 30, 2022 Share Posted April 30, 2022 Start commenting out code until you don't get the error. Or better yet, comment out all first and try just echo('hello');. If still an error, try just an html page without php. Check your php error logs and http logs. If php runs but not all your script, check what versions of php are running on both local and kkgramping. Quote Link to comment https://forums.phpfreaks.com/topic/314748-php-on-directory_separator-script/#findComment-1595829 Share on other sites More sharing options...
mac_gyver Posted April 30, 2022 Share Posted April 30, 2022 these statements are defining filesystem paths. on your development system this results in: SITE_ROOT being set to the folder - $_SERVER['DOCUMENT_ROOT']/job1212 and LIB_PATH being set to the folder - $_SERVER['DOCUMENT_ROOT']/job1212/include on your live site, the full URL of your web site has nothing directly to do with the filesystem paths (the document root value may in fact contain a portion of your domain/account name) that will be used by php to require those various files. what exactly is the filesystem structure within the document root folder on the live site for the main files and the include folder? Quote Link to comment https://forums.phpfreaks.com/topic/314748-php-on-directory_separator-script/#findComment-1595830 Share on other sites More sharing options...
chanthalath Posted April 30, 2022 Author Share Posted April 30, 2022 Please see source code as this link https://www.campcodes.com/projects/php/online-job-search-system-using-php-mysql-free-download/ I have downloaded from website and try to upload online website. Please suggest me to run online website. Thank you in advance. Quote Link to comment https://forums.phpfreaks.com/topic/314748-php-on-directory_separator-script/#findComment-1595832 Share on other sites More sharing options...
ginerjm Posted April 30, 2022 Share Posted April 30, 2022 Minor point but since we are learning: You don't need () around the require or include statement require_once PATH . 'index.php'; Quote Link to comment https://forums.phpfreaks.com/topic/314748-php-on-directory_separator-script/#findComment-1595833 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.