DeveloperSide.NET Forums
July 06, 2020, 06:01:20 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How do I change PHP include path?? php.ini+where!!  (Read 46537 times)
0 Members and 1 Guest are viewing this topic.
andrewc
Member
*
Posts: 5


View Profile
« on: September 10, 2004, 02:23:37 PM »

Hi there

Any help would be much appreciated. I am trying to install phpauction XL (a complex php script) on the web suite and have run into a problem!!
I have run a compatability script for this software  and it says my "include_path" of .;c:\php4\pear" is not compatible!!

Just where does it get this path from?? I have checked PHP.ini and it says the path is C:\php\includes (for windows).....when I change this (to another path eg/the script includes path) it still says incompatible on the test script and the real script will not run....I have done this install as per the readme's and I can only get a blank page to come up on the admin page startup (this is stored in the includes dir which I assume is not being pointed to correctly?) The install pages of the script all worked fine except again the 3rd page of the install required all the config parameters for files located in the "includes" dir...and it did not seem to write the values to them so I had to manually install.

To summarise....can anyone tell me where is the correct place for the includes folder/or what is the correct path/s or what changes do I need to make to get the current one working with this script.
The Php script is in the www\webroot\php_auctionXL folder and the includes folder is within this. PLEASE can someone help me out here!!
Thanks in advance admin!!
Logged
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #1 on: September 10, 2004, 05:42:10 PM »

php.ini
Code:

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"  
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"


Uncomment (remove the ";") and change to a valid dir, that exists, pointing to your script's include dir...
(there is no php\includes dir -- you could create one if you want to)

Code:

include_path = ".;C:\www\webroot\php_auctionXL\includes"


You will probably need to reinstall your script.

And why was it giving you a value of...
c:\php4\pear
That is not even close.
Unless you have a previous php4 installation, and its location in the PATH.
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
andrewc
Member
*
Posts: 5


View Profile
« Reply #2 on: September 12, 2004, 05:09:48 PM »

Thanks for that info admin...
No idea where the c:\php4\pear includes path came from as no previous PHP installs on this mc!!
I changed the includes directory in php.ini to the correct one and now the install script is working and it seems to writing the values to the files in the includes directory BUT....after the install is comleted/dtb created etc.... it says to log on to the admin page to actually set up the auction...

Now...when I try and do this, all that is coming up is a blank page!!No error messages..just a blank page!!...the source for the page is very basic ...eg/not the real source for that page??

I do know this script is meant to operate under windows but is advised for unix as there is some known issues in its operation...accessing the admin page I'm sure is not one of them, it is just not meant to be run on a commercial site under windows...which is fine because once I've learned about it more I will install it on a unix server I am building for when the site is live! (at the minute it is all offline testing)

The apache error log lists this as the problem relating to the blank page..

[client 127.0.0.1] PHP parse error: parse error, unexpected T_STRING in C:\\www\\webroot\\phpauctionXL\\includes\\config.inc.php on line 27

Any ideas anyone...please!!

Also, the auctiontest script that initially told me that my includes path was not "compatible" with the script still highlights my includes path in red and says it's not compatible???

Any ideas??

Also, can I list multiple include paths for any different php scripts in php.ini as long as they are seperated properly with a semi colon and a slash??
Is this the equivalent of creating an includes folder in the php or webroot dir and putting this path in php.ini and pointing all the scripts to it??

Finally, I have installed another php script called ematchmaker to test if my setup is working and it seems to be working A1 after a bit of tinkering!!

Any suggestions gratefully received....

Thanks in Advance...
Logged
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #3 on: September 12, 2004, 06:51:23 PM »

Quote

Also, can I list multiple include paths for any different php scripts in php.ini as long as they are seperated properly with a semi colon and a slash??


Yes.  But no slash, just ";".  The example does not use drive letters.

Quote

Is this the equivalent of creating an includes folder in the php or webroot dir and putting this path in php.ini and pointing all the scripts to it??


I'm not sure what you are saying...  But I think "yes".

Quote

[client 127.0.0.1] PHP parse error: parse error, unexpected T_STRING in C:\\www\\webroot\\phpauctionXL\\includes\\config.inc.php on line 27


Have you taken a look under config.ini.php, line 27?  It is saying it can not parse (understand) the code.
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
andrewc
Member
*
Posts: 5


View Profile
« Reply #4 on: September 12, 2004, 08:00:24 PM »

Hi there...
Thanks for the reply.
Sorry for not being clearer! What I meant in relation to "creating an includes folder in the php or webroot dir" was....

Can I do either one of these options?

1/Put the relevant path to the includes folder of any of my php scripts in to php.ini (not just the auction one)
eg/include_path= ".;C:\www\webroot\php_auctionXL\includes";".;C:\www\webroot\Ematchmaker\includes" etc....

2/Create a directory called "includes" within my webroot directory, and change the path in php.ini to point to it....then put ALL of the includes folders from my PHP scripts in to this new folder and modify their config files to give the correct path to the NEW includes folder??Would this even work???

The main bit!!
The parsing error....
Can I just check to confirm I am looking at the correct bit of code, is line 27 found by literally starting from line 1 (very top line? or is this 0?)with the cursor and counting down 27 lines (using wordpad) or should I start counting from the first line of code??(or where!)

This is the complete config.inc.php (sorry for size!)

<?
#///////////////////////////////////////////////////////
#//  COPYRIGHT 2004 Phpauction.org ALL RIGHTS RESERVED//
#///////////////////////////////////////////////////////

        $SESSION_NAME = "PHPAUCTIONXL_SESSION";
        session_name($SESSION_NAME);
        session_start();
      
      
      #// ########################################################################################

      #// Test mode
      #// TESTMODE variable will force Phpauction XL to run in "test mode" ($PHPAUCTION_TESTMODE = 'yes')
      #// or in "live mode" ($PHPAUCTION_TESTMODE = 'no')
      #//
      #// When running in test mode Phpuction will provide you the ability to use the Paypal simulator
      #// to simulate the payment processes
      $PHPAUCTION_TESTMODE = 'yes'; // Possible values: 'yes, 'no'      
      #// ########################################################################################

         //-- This is the directory where passwd.inc.php file resides - requires ending slash
       
        $include_path = "C:\www\webroot\phpauctionXL\includes\";

        //-- This is the directory where users pictures will be uploaded - requires ending slash
        //-- Under Windows use something like C:\path\to\you\uploaddir\

        $image_upload_path = "C:\www\webroot\phpauctionXL\uploaded\";
        $uploaded_path = "uploaded\";
 

        //--
        $MAX_UPLOAD_SIZE  = 51200;

       
       
        //-- This string is added to passwords before generating the MD5 hash
        //-- Be sure to never change it after the firt set up or
        //-- your users passwords will not work
        $MD5_PREFIX = "qwertyuiop";
       
       
        /*
                This is the log file generated by cron.php - insert the complete
                file name (including the absolute path).
                If you don't want to generate a log file for cron activity simply
                leave this line commented.
        */

        #$logFileName = "/var/www/auctions/logs/cron.log";
        #$logFileName = "C:\path\to\cron.log";

        /*
                Set this to TRUE if you want cron to generates HTML output
                BESIDES the cron file declared above. cron.php cannot generates
                only HTML output.
        */
        $cronScriptHTMLOutput = FALSE;
      
      include $include_path."settings.inc.php";
            /** *************************************************************
      * NOTE: Language management
      */
      if(!empty($_GET['lan']))
      {
         $language = $lan;
         $_SESSION['language'] = $language;

         #// Set language cookie
         setcookie("USERLANGUAGE",$lan,time()+31536000);
      }
      elseif(empty($_SESSION['language']) && !isset($_COOKIE['USERLANGUAGE']))
      {
         $language = $SETTINGS['defaultlanguage'];
         $_SESSION['language'] = $language;

         #// Set language cookie
         setcookie("USERLANGUAGE",$language,time()+31536000);
      }
      elseif(isset($_COOKIE['USERLANGUAGE']))
      {
         $language = $_COOKIE['USERLANGUAGE'];
      }

      #// If the user is logged in, update the user's record
      #// This is used to send the e-mails in the user's language
      if(isset($_SESSION['PHPAUCTION_LOGGED_IN']))
      {
         mysql_query("DELETE FROM PHPAUCTIONXL_userslanguage WHERE user='".$_SESSION['PHPAUCTION_LOGGED_IN']."'");
         mysql_query("INSERT INTO PHPAUCTIONXL_userslanguage VALUES(
                   '".$_SESSION['PHPAUCTION_LOGGED_IN']."',
                   '$language')");
      }
      require($include_path.'messages.'.$language.'.inc.php');
      /* **************************************************************/
      include $include_path."languages.inc.php";
?>


Lastly,this is the include path bit from my php.ini.....

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"  
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
include_path = ".;C:\www\webroot\phpauctionXL\includes"

; The root of the PHP pages, used only if nonempty.
; if PHP was not compiled with FORCE_REDIRECT, you SHOULD set doc_root
; if you are running php as a CGI under any web server (other than IIS)
; see documentation for security issues.  The alternate is to use the
; cgi.force_redirect configuration below
doc_root = C:/www/webroot/



Can you see any glaring errors or omissions here?
Any help gratefully appreciated.....

TIA
Logged
admin
Administrator
Master of All Subjects
*****
Posts: 3272


View Profile WWW Email
« Reply #5 on: September 12, 2004, 08:15:41 PM »

Quote

1/Put the relevant path to the includes folder of any of my php scripts in to php.ini (not just the auction one)
eg/include_path= ".;C:\www\webroot\php_auctionXL\includes";".;C:\www\webroot\Ematchmaker\includes" etc....


Yes.

But you have the syntax all wrong...
Its...
Code:

include_path= ".;C:\www\webroot\php_auctionXL\includes;C:\www\webroot\Ematchmaker\includes"


Quote

2/Create a directory called "includes" within my webroot directory, and change the path in php.ini to point to it....then put ALL of the includes folders from my PHP scripts in to this new folder and modify their config files to give the correct path to the NEW includes folder??Would this even work???


Yes.

Quote

Can I just check to confirm I am looking at the correct bit of code, is line 27 found by literally starting from line 1 (very top line? or is this 0?)with the cursor and counting down 27 lines (using wordpad) or should I start counting from the first line of code??(or where!)


First line of the file is line number 1.  Go to line 27.
Logged

DeveloperSide.NET
Advanced PHP and MySQL Solutions for your Web Design and Development needs with Web.Developer Server Suite.
andrewc
Member
*
Posts: 5


View Profile
« Reply #6 on: September 12, 2004, 08:47:44 PM »

Thanks for the syntax correction on the includes path...it wont help the auction script but it will help any future scripts!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!