include_path
Posted by: mikeb (---.dsl.pltn13.sbcglobal.net)
Date: November 07, 2007 01:30AM

I do not know how to change the include_path, other than setting it with every page.

It seems the value for include_path in path.ini does not count: modified or not, the include path does not change. It is always ".;c:\php5\pear" !
I found that this string is actually hard-coded into php5ts.dll.

Does anybody know how to make the change customizable & permament?

I have to admit that I just installed the package a couple of days ago and I am not very familiar with it.
Other than this annoyance, wamp has been a very nice, saving time experience. Congratulations and thanks to the author/s.

Thank you.
Mikeb.


Options: ReplyQuote
Re: include_path
Posted by: toivo (203.19.130.---)
Date: November 09, 2007 11:41PM

Hi,

There are two php.ini files in the WAMP system, and c:\wamp\php\php.ini controls the PHP command line (CLI) scripts. The php.ini file which controls your PHP scripts in Apache is in c:\wamp\apache2\bin. Customising the path should then work, for example:
include_path = ".;c:\wamp\php\includes"

The go-pear script seems to modify the include_path.

Regards,



toivo
Sydney, Australia

Options: ReplyQuote
Re: include_path
Posted by: rbn (195.171.21.---)
Date: November 10, 2007 10:50AM

Anyone found the answer to this yet? I have exactly the same problem that Mikeb describes. The includes path seems to be fixed at ".;c:\php5\pear" I am trying to alter it to ".;c:\wamp\php\includes" (I have made the includes folder in this path) and I have altered it in both the php.ini file in apache2\bin and in the php folder, and restarted all services, but it still shows as the original path in phpinfo.
I don't require PEAR. If this is forcing the change to the path as suggested by mikeb is it possible to disable it so that I can set the includes path as I want?

RBN

Options: ReplyQuote
Re: include_path
Posted by: toivo (203.19.130.---)
Date: November 10, 2007 01:55PM

Hi rbn,

Is it possible that your workstation has more than one PHP installation? That would explain why the editing of both the php.ini files in the c:\wamp folder does not seem to have any effect.

If you create a file phpinfo.php and browse to it, it will tell you where the php.ini file is:

<?php
phpinfo();
?>

The output will display a line close to the top of the listing:

Loaded Configuration File C:\wamp\Apache2\bin\php.ini

Regards,



toivo
Sydney, Australia

Options: ReplyQuote
Re: include_path
Posted by: yfastud (---.cable.mindspring.com)
Date: November 12, 2007 03:08AM

There is nothing wrong to have more than 1 php or mysql; I'm running php5, php6, mysql5, and mysql6 as well as sql, asp.net, jsp, so on. The main key is you have to set them up properly so they can happily run together. As toivo already mentioned, you should find out the correct php.ini that control your php scripts; if it's old php, either configure to run together w/ php that come w/ wamp or if you're not sure how to, better uninstall it, clean it up even in registry

Have fun,

[test.jlbn.net] (Sample Testing Codes for PHP, MySQL, ASP.net, SQL, JSP)
[www.jlbn.net] (Basic Guide for WAMP & Add-ons)

Options: ReplyQuote
Re: include_path
Posted by: rbn (195.171.21.---)
Date: November 15, 2007 05:47PM

Doh!!!! I forgot to uncomment the line: left a ; there. All OK now!
Robin

Options: ReplyQuote
Re: include_path
Posted by: manoj (---.opera-mini.net)
Date: September 04, 2009 10:14AM

wampserver include php and jsp then what is the path setting in system variable and user variable

Options: ReplyQuote
Re: include_path
Posted by: roger (41.27.124.---)
Date: January 27, 2010 05:54PM

Hi all
I have an app that is running well in LAMP. It runs over the web ond on a local server in Linux. No problems at all.
I have now ported it to WAMP. During the port I copied the exact Dir structure from Linux to Windows. The only difference is where it was 'home' in Linux I made it 'wamp' on Windows.Otherwise exactly the same.
Right throughtout the app I use relative paths. At no time do I refer to either 'home' or 'wamp'.
When I installed WAMP I had no problems. A small hiccup when I set the Apache2 alias but easily resolved. Since I am getting to my index.php I think it is correct.

Code snippet in index.php

<?php
set_include_path('../include/:../../:../');
echo 'aaaaa '.__LINE__;
require_once('Template.php');
require_once('../code/TemplateHelper.php');

When I run I get the folowwing error
aaaaa 3
Warning: require_once(Template.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\vault\public\index.php on line 4

Fatal error: require_once() [function.require]: Failed opening required 'Template.php' (include_path='../include/:../../:../') in C:\wamp\www\vault\public\index.php on line 4

It just doesn't seem to recognise the set_include_path('../include/:../../:../'); statement.

However if I change the code to
<?php
set_include_path('../include/:../../:../');
echo 'aaaaa '.__LINE__;
//require_once('Template.php');
require_once('../code/TemplateHelper.php');

I get the same error except inside TemplateHelper.php so require_once('../code/TemplateHelper.php'); seems to have worked but then its failed on the next require_once inside TemplateHelper

aaaaa 3
Warning: require_once(helpers/Savant3_Plugin_getDirectoryStructure.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\vault\code\TemplateHelper.php on line 2

Fatal error: require_once() [function.require]: Failed opening required 'helpers/Savant3_Plugin_getDirectoryStructure.php' (include_path='../include/:../../:../') in C:\wamp\www\vault\code\TemplateHelper.php on line 2

I have tried setting absolute paths, changing '/' to '\', playing with the alias file but have not touched either the apache2 or php ini/config files.

I am at my wits end so any help will be really, really appreciated

Options: ReplyQuote
Re: include_path
Posted by: c2dan (---.15-1.cable.virginmedia.com)
Date: January 27, 2010 06:29PM

On Windows you need to separate your file paths with a semi-colon instead
set_include_path('../include/;../../;../');

You will be better of setting absolute file paths within set_include_path().

Options: ReplyQuote
Re: include_path
Posted by: roger (41.27.124.---)
Date: January 27, 2010 07:01PM

Hey thanks for that very quick response.

Tried the ';' and it gets further so it seems that ';' is part of the answer. The problem is that I now get a php error
Fatal error: Method Savant3::__tostring() cannot take arguments in C:\wamp\www\vault\include\savant\Savant3.php on line 244

which is invoked by the savant3 helpers included in the TemplatHelper

but at least it means the includes have been found. I think this last error is going to be something to do with 'magic quotes' in php.

The problem with absolute paths is that the only reason I have gone WAMP is so that I can test in multiple browsers. I have a lot of JS and want the debuggers that come with each browser in Windows. They don't all have debuggers in Linux. My problem is mainly with IE since it takes the non-standard 'path less travelled' with respect to its DOM and CSS implementation. But hey; what would we do without these challanges.

The actual live app is still going to live on a Linux server and be accessed over the web.

If you have any suggestions with regard to the new problem I will appreciate your thoughts. I am thinking it might be a setting in the ini/config files so that where I will start first.

Many thanks
When I eventually find the solution I will post it to this site

Options: ReplyQuote


Sorry, only registered users may post in this forum.