include_once does not behave as expected

Chiel

New member
Joined
Apr 20, 2023
Messages
2
Hello,

I am using the following line:
include_once __DIR__ . '\script\framework.php';

The include_once line is located in /public_html/index.php
The framework.php file is located in -> /public_html/script/framework.php
It contains a block of html I want to print on the page

The issue
Nothing happens. No error just a blank page without the include_once having any effect. What am I missing?
 
Are you a Directadmin admin or reseller? If not, you're on the wrong forum, this is a support forum for DA admins and resellers only.

As for your question, maybe you need to use / instead of \ character.
 
I am using Directadmin. There is Apache error logs I find through the System Info > Statistics. But these are very limited and did not show errors when I ran the software. I am guessing because "include_once" throws a warning but I only recently started working with Directadmin so trying to make my way. : )

Thank you for your reply. It fixed this issue.
 
first thing, you must use "/" for linux system. or use this variable to comparative between window and linux system.
Code:
DIRECTORY_SEPARATOR
 
Thank you for your reply. It fixed this issue.
You're welcome.
Sorry for the questions but normally we see more questions about the panel itself, so hence I was wondering.

You might want to (carefully) also start to work or find things via SSH.
For example the /var/log/httpd/domains/domain.com.log and error log might also be helpful in some cases.
 
Back
Top