james3302 Posted November 8, 2007 Share Posted November 8, 2007 I have taken over a job and one of my functions is updating and improving a website that creates reports from a Oracle DB. There are many php files and each of them has the DB connection details at the top of the file. I am wanting to make one file that has the connection details and require in each file, which would make it easier to update the connection details. I was told that in my php.ini that I had to update my include_path to say(oh yea php is installed on the c drive and the website data is on the g drive). include_path ".;g:\website\inetpub\wwwroot\..."; I then copied that connection details out of one file and pasted it into a new file and named it SouthDBConnection.php(saved it at the above mentioned path). I then placed the line of code require('SouthDBConnection.php'); in place of the connection details. it does not connect. I have been using include instead to see whats going on. I tried putting echo "test"; into the SouthDBConnection.php file to see if it will echo onto the screen and it does not. I have tried using include_path ".g:\website\inetpub\wwwroot\..."; and include_path "g:\website\inetpub\wwwroot\..."; and nothing works Quote Link to comment Share on other sites More sharing options...
james3302 Posted November 12, 2007 Author Share Posted November 12, 2007 Well, I got it working after some trial and error, I used an absolute path(which it did not like the first time I tried it). I can now take that line out of the php.ini file. Quote Link to comment Share on other sites More sharing options...
revraz Posted November 12, 2007 Share Posted November 12, 2007 Instead of modifing the PHP.INI for the Include path, you could just enter it into your PHP pages. Another way is using your .htaccess file. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.