PHP - Include_path Directive Troubleshooting
I am having difficulties with my include_path directives in the php.ini file. Please click the link below to see a screencast of the problem:
http://screenr.com/vhY I am very confused as sometimes the include_path does work and sometimes it doesn't work. Also am I allowed to have multiple include_path directives or do I need to include every path in a single include_path directive. Similar TutorialsI'm just looking for some tips here. I am developing and selling an eccommerce shopping cart software package, and it has been received very well from the early adopters. There's just one small problem that prevents the software from being a truly out-of-the-box solution: the include path. Not all users have access to their php.ini file, and it's not always a php.ini file anyway. So this is something the installation is unable to set for the customer. I'm using object-oriented PHP5 stuff, so I have a folder named "classes" with all the relevant stuff in there. I am unable to search for paths to the folder and hard-code those into source files (there are ajax calls and other fun stuff; hard to know the exact relation to the path). I guess I could use set_include_path on the top of a bunch of files, but that is a small performance hit (and totally inelegant code). I could put the folder path in the database somewhere and query for it (and cache it so it's not a performance hit). None of this stuff seems good. The path seems like the best solution. Unless you have better ideas.... Hi all "im new here" Hoping someone can help me with this peculiar problem. I have a vps running Plesk (9.5.4) + PHP 5.3 For the domain I am working on, I have specified additional directories to the PHP include_path via vhost conf file. One of those directories is outside of webroot, so is same level as httpdocs. eg: :/var/www/vhosts/example.com/outer_includesMy scripts are able to include PHP files, using require, include etc from the directory added to PHP's include, so I know that its working perfectly. Problem I have is that if I call a script with HTTPS, I get require_once fatals, as for some reason the includes no longer work. --------------------------------------------------- eg: include_me.php lives in a directory on same level as httpdocs, which has been added to PHP include directories. /var/www/vhosts/example.com/outer_includes/include_me.phpscript.php contains: <?php require_once('include_me.php'); ?>Calling: http://www.example.com/script.php This works as expected. Calling: https://www.example.com/script.php This fails with fatal on the require_once() --------------------------------------------------- I am self taught and fully expect this to be another hole in my knowledge but I can't seem to fill this one by asking Google. Can anyone advise? Would be very grateful Boreas Edited by Boreas, 02 September 2014 - 04:20 PM. This topic has been moved to Application Frameworks. http://www.phpfreaks.com/forums/index.php?topic=330453.0 I have a page that processes a variable passed in the url to go get information out of a text file in JSON format. For some reason though, passing one variable loads a page, passing a certain variable (who's data in the file is virtually identical to the first) will cause the browser to just load the page indefinitely. Maybe even more strange is that on my local machine, the variable that won't load is switched, and the other loads fine. How can I debug what's happening when the page never loads so that I never get an error? I am creating an add on to a 3rd party CMS called Concrete5. Normally, when I have client issues, I can trace them to the server and fix them, however, this not doing so well on these issues. The following errors are being displayed in Chrome console:
Checking the server’s folder directory, it is true there is no concrete/fonts directory but there is a concrete/css/fonts directory with a couple of the missing files (but not glyphiconshalflings-regular.woff2).
Back to the errors, clicking the line number (i.e. 927, 3115, and 1), chrome blames apparently innocent line numbers.
What steps would you recommend taking to identify the cause and fix these errors? I'm playing with this tokenizing autocomplete script but am having a strange issue with it. It all seems to work ok and it's pulling the values over from the php file that's doing the db query ok and if you put in a value that doesn't match it will tell you so, however if you do type in a value that matches it simply disappears. This script is exactly like the demo script except for the paths to the js, css, and php files, and I did remove the 1st example but was having this issue before removing it. No changes made to the js file, php file is identical to the demo just with my own db info and table info put in, and no changes to the css file compared to the demo. I've tried this both with jquery 1.3.0 and 1.4.2 and have the same issue with both. Here is the link to my test page: http://www.erecoverydev.com/autocomplete2/autocomplete.html Here is my js file: http://www.erecoverydev.com/autocomplete2/jquery.tokeninput.js Here is my php code: Code: [Select] <? mysql_pconnect("localhost", "myuser", "mypass") or die("Could not connect"); mysql_select_db("mydb") or die("Could not select database"); $query = sprintf("SELECT cb_activities from jos_comprofiler WHERE cb_activities LIKE '%%%s%%' ORDER BY cb_activities DESC LIMIT 10", mysql_real_escape_string($_GET["q"])); $arr = array(); $rs = mysql_query($query); while($obj = mysql_fetch_object($rs)) { $arr[] = $obj; } echo json_encode($arr); ?> A couple of values that are in my table are web development and kicking cats if you want to test it. Here is the link to the demo: http://loopj.com/tokeninput/demo.html It just doesn't make any sense to me why the demo works and mine doesn't when they are basically identical. trying to use a require but not working properly Fatal error: require() [function.require]: Failed opening required 'get_extra.php?id=1' (include_path='.') first thing set on page is.. page is profile.php?id=1 $userid = $_GET['id']; code is:require "get_extra.php?id=$userid"; what can i do to fix this? thanks |