Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.