Help me please .... relative_path does not work

I have a problem that i fail to solve even if i looked everywhere in the last three days

I have a site that was moved from a host (shared) to a dedicated server where I installed Ubuntu server 11.10 and then Webmin/Virtualmin.

I did all the settings and i put the site on the new server but i have some files that do not work (although on the old server were not problems).

If i have a file A that includes another file B which in turn includes a file C. … does not work (in the files are set relative paths)

It seems that the file C is not included because when the file B is included in file A is losing relative path to the file C

I think it is a setting of Apache/PHP because this site has worked on another server (also Linux) and I have another site hosted on another server (shared) with the same files structure and that works without problems.

I’ll show you an example of files with problems:

-public_html -folder1 -file A.php
  -includes
        -file B.php
        -monofont.ttf

in file A is this line:
(is a file for captcha)

in file B is this line:
var $font = ‘monofont.ttf’;

All above must show a captcha image in page but does not work(i guess when file B is included in file A is loosing the path to monofont.ttf which is relative not absolute)
…if i set in file B absolute path for monofont.ttf ($font = ‘/home/domain/public_html/includes/monofont.ttf’;) is show the image

Please help me.

I dont want to change the php codes because are many many files in this situation.
I am sure is a problem of setting apache/php because as i said already the site is working with no problems on another 2 linux servers (without webmin/virtualmin)

First idea, like always with problems under Linux, is check logfiles, then check more logfiles. So you should turn on debug logging in PHP, so it displays and logs any problems it encounters. Then check Apache access and error logfiles for problems.

Without any further information why including those files fails, it is very hard, especially for us, to give any advice. All we could do is guess.

Also, it is recommended to use Virtualmin only with LTS versions of Ubuntu, the current one being 10.04. In about a month the next one will come out. Other (non-LTS) versions may work, but are not officially supporter and not guaranteed to work.

Finally, you should use a more specific and explaining/summarizing thread title. Just “help me” is not going to attract overly many readers.

if this is some kind of CMS then look into your configuration.php or settings.php and also look in your .htaccess file.
There may be some clues there…

i have instaled again ubuntu server …now virtualmin is on Ubuntu 10.04.4 LTS …but same problems

i have another server with ubuntu 10.10 instaled long time ago (without Webmin/Virtualmin) and i put the site on this server and is working without the problems above(again … is the same structure of files)

i have compared these 2 servers … phpinfo,php.ini and apache conf are almost identical

what is missing ?

Well, have you, as I suggested, checked the logfiles? As I said, without any further hint as to what problem exactly occurs, it’s next to impossible to give a hint.

The Apache access and error logs are in /var/log/virtualmin, or you can read them in Virtualmin itself.

yes i have checked the log files…nothing concrete

i instaled in virtualbox ubuntu server 10.04.4 LTS with only openssh and after that ,as root, i instaled lamp like that :

apt-get install apache2 -y
apt-get install mysql-server-5.1 -y
apt-get install php5 php5-cli php5-mysql libapache2-mod-php5 -y
apt-get install phpmyadmin

i put the files for site in /var/www/site and the problem no longer exists (the user and owner for folder “site” is root)

so what is the problem when i install Virtualmin?
Why the problem is only with Virtualmin?

Okay, so now that you have Ubuntu 10.04 on there – what is the specific problem you’re seeing when trying to setup this site within Virtualmin?

-Eric

I stated from the beginning the problem.

if on a clean system i install Virtualmin i have the problems above but on a clean system with only lamp installed i dont have the problems above

Do all the files belong to the domainowner? As under LAMP you say it works when user and owner is root.
This sounds like a permission/rights issue where the current user under virtualmin is not allowed to do anything with files belonging to, let’s say, root.

With debug set to on you will see what the problem is…but you can chown all the files to the current virtualmin user.