Hi,
I am trying to set a new include_path. My site is on a local server with various sub-directories for different web projects.
I have a php tutorial site in the following share on a QNAP server - qweb/phplearning. I want to add this directory to the include_path. I'm struggling with the correct syntax to use.
Any help gratefully received. Sorry if this is a bit basic.
Cheers,
Mike
include_path in php.ini on local server
Moderator: General Moderators
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: include_path in php.ini on local server
If you want to set it in php.ini then look here: http://us2.php.net/manual/en/ini.core.p ... clude-path
If you want to set it in the script then look here: http://us2.php.net/manual/en/function.s ... e-path.php
If you want to set it in the script then look here: http://us2.php.net/manual/en/function.s ... e-path.php
(#10850)
Re: include_path in php.ini on local server
Hi Christopher,
Thanks for that.
Yes, I've already looked at those links. My problem is the syntax - I've tried various forms, .:/qweb/phplearning , .:/localhost/phplearning, .:ip/phplearning. None of them seem to work. I am, obviously not getting the correct syntax. That is my question - what am I doing wrong. I am sure it is a simple mistake. I understand that you seperate each folder with :
Cheers,
Mike
Thanks for that.
Yes, I've already looked at those links. My problem is the syntax - I've tried various forms, .:/qweb/phplearning , .:/localhost/phplearning, .:ip/phplearning. None of them seem to work. I am, obviously not getting the correct syntax. That is my question - what am I doing wrong. I am sure it is a simple mistake. I understand that you seperate each folder with :
Cheers,
Mike
- Tiancris
- Forum Commoner
- Posts: 39
- Joined: Sun Jan 08, 2012 9:54 pm
- Location: Mar del Plata, Argentina
Re: include_path in php.ini on local server
The separator character depends on the server operating system:
- Linux uses ":".
- Windows uses ";".
It is better to use the PHP constant PATH_SEPARATOR.
- Linux uses ":".
- Windows uses ";".
It is better to use the PHP constant PATH_SEPARATOR.
Re: include_path in php.ini on local server
Hi,
Thanks for that, yep I understand that - on Linux. Path_Seperator - getting more confused
.
I simply wish to understand the correct syntax for point the path to the local hosted directory as described above.
Cheers,
Mike
Thanks for that, yep I understand that - on Linux. Path_Seperator - getting more confused
I simply wish to understand the correct syntax for point the path to the local hosted directory as described above.
Cheers,
Mike
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: include_path in php.ini on local server
You absolute path may be something like "/home/qweb/phplearning". If you can login to a shell in that computer, "cd" to that directory and then run the command "pwd" to show the current absolute path.
(#10850)