Jump to content

Include_path problems


Rabbie

Recommended Posts

Hi

 

I am using PHP with Windows and I am having a few problems with the include function.

 

If I use include("filename.php") or include("dir/filename.php") it works correctly

 

If I use include ("./dir/filename.php") it doesnt include the file.

 

I need this to work so I can use PHPMyadmin for MySQL database control.

 

I have tried googling for a solution without success.

 

In my php.ini file I have  include_path = ".\";

 

What should this be set to please to get this to work?

Link to comment
https://forums.phpfreaks.com/topic/73841-include_path-problems/
Share on other sites

Here is what I can see.

 

The reason that ("./dir/filename.php") doesn't work is because you have specified that includes default to the root web directory.  Having the '.' preceding the slash knocks you back another directory which ultimately produces an invalid path to the file.

Link to comment
https://forums.phpfreaks.com/topic/73841-include_path-problems/#findComment-372584
Share on other sites

I am only using this way because it is in the phpmyadmin files. I don't know why they use the include "./ format but it should work being a well proven product.

 

I am sure it is an issue in my php.ini since I can replicate the fault in my own files.

 

I have taken out the include_path directive and it made no difference. what worked before still works and the other still doesn't

Link to comment
https://forums.phpfreaks.com/topic/73841-include_path-problems/#findComment-372618
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.