From: Brett O'C. <oco...@do...> - 2002-11-05 19:57:40
|
Hello PHPiCalendar Developers! I recently installed PHPiCalendar on a Linux 7.3 / PHP 4.2.3 server and=20= had some problems regarding the code below (lines 37-40 in=20 functions/init.inc.php): if (file_exists($lang_file)) { include($lang_file); } else { exit(error('The requested language "'.$language.'" is not a = supported=20 language. Please use the configuration file to choose a supported=20 language.')); }=00=00 It appears that file_exists will be false if the web user running under=20= apache does not have permission to peruse the full directory string (or=20= at least that's what I suspect so far). I also noticed someone else had this problem in this forum message: http://phpicalendar.sourceforge.net/phpBB2/viewtopic.php?t=3D92&highlight=3D= S/he was having this problem on Linux also. I just commented out the if statement for now and forced the include=20 and things work great, but I thought you would like to know about this=20= bug. If I am able to come up with a better solution (perhaps a way to=20= check for the file via URL string?) I will let you know. Brett -- Brett O'Connor Dogheadbone LLC P.O. Box 171 Littleton, CO 80160 Phone: 303.797.2992 AIM: BrettDHB E-Mail: oco...@do... Web: http://www.dogheadbone.com/= |
From: Waitman C. G. <wa...@em...> - 2002-11-05 20:25:55
|
are you running php in cgi mode? check your phpinfo(); near the top it will tell you. apache2 module "Server API" Apache 2.0 Filter apache module "Server API" Apache cgi "Server API" CGI The init.inc.php thing sets "BASE" to be "./" So it would be relative to the current working directory. If your current working directory is not the same as the calendar root then file_exists() won't work. put this at the top of functions/init.inc.php <?php echo getcwd(); then pull your calendar up in your browser, look what it prints at the top of the page - and see if it makes sense. The reason I ask about the CGI mode above, this is the first thing that I can think of that could cause your current working directory to be different then the actual script file. another possibility could have to do with symbolic links. you might think your pages are located at /www/web/html/directory/ but they are really located at /x346346/fijaiogjg/home/akwjfkj/html/directory and php is getting confused. so try the echo getcwd() command and we will go from there ;-) best, Waitman Gobble EMK Design Buena Park California +1.7145222528 http://emkdesign.com On Tue, 2002-11-05 at 11:57, Brett O'Connor wrote: Hello PHPiCalendar Developers! I recently installed PHPiCalendar on a Linux 7.3 / PHP 4.2.3 server and had some problems regarding the code below (lines 37-40 in functions/init.inc.php): if (file_exists($lang_file)) { include($lang_file); } else { exit(error('The requested language "'.$language.'" is not a supported language. Please use the configuration file to choose a supported language.')); } It appears that file_exists will be false if the web user running under apache does not have permission to peruse the full directory string (or at least that's what I suspect so far). I also noticed someone else had this problem in this forum message: http://phpicalendar.sourceforge.net/phpBB2/viewtopic.php?t=92&highlight= S/he was having this problem on Linux also. I just commented out the if statement for now and forced the include and things work great, but I thought you would like to know about this bug. If I am able to come up with a better solution (perhaps a way to check for the file via URL string?) I will let you know. Brett -- Brett O'Connor Dogheadbone LLC P.O. Box 171 Littleton, CO 80160 Phone: 303.797.2992 AIM: BrettDHB E-Mail: oco...@do... Web: http://www.dogheadbone.com/ ------------------------------------------------------- This sf.net email is sponsored by: See the NEW Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en _______________________________________________ Phpicalendar-devel mailing list Php...@li... https://lists.sourceforge.net/lists/listinfo/phpicalendar-devel |
From: Brett O'C. <oco...@do...> - 2002-11-05 21:41:18
|
Hi! Thanks for responding. No, I don't think this server is running in cgi mode. Here is a link to the phpinfo() for the server: http://mephisto.intelligent-imaging.com/oconnorb/phpinfo.php Although I must admit I didn't think of that. Also, as far as I can tell the base dir resolves correctly. Here is a link to my calendar where I echo it at the top: http://mephisto.intelligent-imaging.com/oconnorb/ Also, below that, I am echoing the $lang_file string. Perhaps you see something amiss? Thanks again for the response! Brett On Tuesday, November 5, 2002, at 01:30 PM, Waitman C. Gobble wrote: > are you running php in cgi mode? check your phpinfo(); > > near the top it will tell you. > > apache2 module "Server API" Apache 2.0 Filter > apache module "Server API" Apache > cgi "Server API" CGI > > > The init.inc.php thing sets "BASE" to be "./" > So it would be relative to the current working directory. > > If your current working directory is not the same as the calendar root > then file_exists() won't work. > > put this at the top of functions/init.inc.php > > <?php > echo getcwd(); > > then pull your calendar up in your browser, look what it prints at the > top of the page - > and see if it makes sense. > > The reason I ask about the CGI mode above, this is the first thing that > I can think of that could cause your current working directory to be > different then the actual script file. > > another possibility could have to do with symbolic links. > > you might think your pages are located at > /www/web/html/directory/ > > but they are really located at > /x346346/fijaiogjg/home/akwjfkj/html/directory > > and php is getting confused. > > so try the echo getcwd() command and we will go from there ;-) > > best, > > Waitman Gobble > EMK Design > Buena Park California > +1.7145222528 > http://emkdesign.com -- Brett O'Connor Dogheadbone LLC P.O. Box 171 Littleton, CO 80160 Phone: 303.797.2992 AIM: BrettDHB E-Mail: oco...@do... Web: http://www.dogheadbone.com/ |
From: Waitman C. G. <wa...@em...> - 2002-11-05 22:51:00
|
well, perhaps it is a bug in php/apache. it seems to work fine on my rh 8.0 running apache 2.0.40 / php 4.2.3 reminds me of a problem that USED to exist on windows machines. anyhow, i recommend changing the code in init.inc.php to: $lang_file = getcwd().'/languages/'.$language.'.inc.php'; this should probably prevent trouble even if there isn't trouble to begin with ;-) can you give that a try and see what happens? please be sure to change remove the stuff you had commented out previously to get the thing to work without yelling at you on the file_exists line... actually, i will suggest that in the main code the constant BASE be turned into a variable $BASE throughout all the scripts, and set $BASE to getcwd(); I know constants are nice but this isn't really improving performance a noticeable amount. take care! Waitman On Tue, 2002-11-05 at 13:41, Brett O'Connor wrote: Hi! Thanks for responding. No, I don't think this server is running in cgi mode. Here is a link to the phpinfo() for the server: |
From: Brett O'C. <oco...@do...> - 2002-11-05 23:19:03
|
Groovey. That worked with everything else set back to normal. So yea, wierdness. <shrug> Maybe something to do with RH 7.3? Though I can't imagine why. I have been reluctant to upgrade to 8.0. Anyway, I agree that setting $BASE off of getcwd() would be a good idea. However, you guys are really doing a great service to us all, so I won't complain if I have to make a tweak or two to get things working for now. :) Thanks so much! Brett On Tuesday, November 5, 2002, at 03:56 PM, Waitman C. Gobble wrote: > well, perhaps it is a bug in php/apache. > it seems to work fine on my rh 8.0 running apache 2.0.40 / php 4.2.3 > > reminds me of a problem that USED to exist on windows machines. > > anyhow, i recommend changing the code in init.inc.php to: > > $lang_file = getcwd().'/languages/'.$language.'.inc.php'; > > this should probably prevent trouble even if there isn't trouble to > begin with ;-) > > can you give that a try and see what happens? please be sure to change > remove the stuff you had commented out previously to get the thing to > work without yelling at you on the file_exists line... > > > actually, i will suggest that in the main code the constant BASE be > turned into a variable $BASE throughout all the scripts, and set $BASE > to getcwd(); I know constants are nice but this isn't really improving > performance a noticeable amount. > > > take care! > > Waitman -- Brett O'Connor Dogheadbone LLC P.O. Box 171 Littleton, CO 80160 Phone: 303.797.2992 AIM: BrettDHB E-Mail: oco...@do... Web: http://www.dogheadbone.com/ |
From: Waitman C. G. <wa...@em...> - 2002-11-05 23:58:56
|
Glad it worked for you! Totally my opinion: 8.0 is pretty good, it is the first version of RH that could actually live in a typical office environment with "non-computer" people using it as a workstation. I really don't think that the Linux distros can compete with MS Windows until they get their nails hammered down straight, and RH 8 is a mighty big leap in that direction. I probably cheesed off a bunch of Linux people with those statements, but I believe that the market of non-computer people that have incessant need for technical support is MUCH larger than the "technologically advanced" crowd. You see companies of 200 or so employees with only a couple of tech support guys all over the place. If you issue a bunch of machines to average joes, and the machines aren't smoothed all around the corners and bolted shut and tightened down there will definitely be Hell to pay. I haven't tried RH 8 on a real server yet, I haven't had time to figure out all the stuff i gotta rebuild ;-) I guess it is a lesson learned to keep good documentation. Anyhow, you might want to report the file_exists as a bug on php.net? I could do it, but I haven't actually experienced the problem. My guess is that it has absolutely nothing to do with RH 7.3, it is more likely a problem between php 4.2.3 and apache 2.0.43... but this is just a guess! take care, Waitman Gobble EMK Design Buena Park, California +1.7145222528 http://emkdesign.com On Tue, 2002-11-05 at 15:19, Brett O'Connor wrote: Groovey. That worked with everything else set back to normal. So yea, wierdness. <shrug> Maybe something to do with RH 7.3? Though I can't imagine why. I have been reluctant to upgrade to 8.0. Anyway, I agree that setting $BASE off of getcwd() would be a good idea. However, you guys are really doing a great service to us all, so I won't complain if I have to make a tweak or two to get things working for now. :) Thanks so much! Brett On Tuesday, November 5, 2002, at 03:56 PM, Waitman C. Gobble wrote: > well, perhaps it is a bug in php/apache. > it seems to work fine on my rh 8.0 running apache 2.0.40 / php 4.2.3 > > reminds me of a problem that USED to exist on windows machines. > > anyhow, i recommend changing the code in init.inc.php to: > > $lang_file = getcwd().'/languages/'.$language.'.inc.php'; > > this should probably prevent trouble even if there isn't trouble to > begin with ;-) > > can you give that a try and see what happens? please be sure to change > remove the stuff you had commented out previously to get the thing to > work without yelling at you on the file_exists line... > > > actually, i will suggest that in the main code the constant BASE be > turned into a variable $BASE throughout all the scripts, and set $BASE > to getcwd(); I know constants are nice but this isn't really improving > performance a noticeable amount. > > > take care! > > Waitman -- Brett O'Connor Dogheadbone LLC P.O. Box 171 Littleton, CO 80160 Phone: 303.797.2992 AIM: BrettDHB E-Mail: oco...@do... Web: http://www.dogheadbone.com/ ------------------------------------------------------- This sf.net email is sponsored by: See the NEW Palm Tungsten T handheld. Power & Color in a compact size! http://ads.sourceforge.net/cgi-bin/redirect.pl?palm0001en _______________________________________________ Phpicalendar-devel mailing list Php...@li... https://lists.sourceforge.net/lists/listinfo/phpicalendar-devel |
From: Brett O'C. <oco...@do...> - 2002-11-06 00:22:42
|
Yea, but what's up with the way it looks all soft and blue like XP? ;) J/K I have to confess the main reason I haven't upgraded is that I'm just lazy. But you do make some good points. Anyway, I've added the bug to the sourceforge project. Thanks again! Brett On Tuesday, November 5, 2002, at 05:04 PM, Waitman C. Gobble wrote: > Glad it worked for you! > > Totally my opinion: 8.0 is pretty good, it is the first version of RH > that could actually live in a typical office environment with > "non-computer" people using it as a workstation. I really don't think > that the Linux distros can compete with MS Windows until they get their > nails hammered down straight, and RH 8 is a mighty big leap in that > direction. > > I probably cheesed off a bunch of Linux people with those statements, > but I believe that the market of non-computer people that have > incessant > need for technical support is MUCH larger than the "technologically > advanced" crowd. You see companies of 200 or so employees with only a > couple of tech support guys all over the place. If you issue a bunch of > machines to average joes, and the machines aren't smoothed all around > the corners and bolted shut and tightened down there will definitely be > Hell to pay. > > I haven't tried RH 8 on a real server yet, I haven't had time to figure > out all the stuff i gotta rebuild ;-) I guess it is a lesson learned to > keep good documentation. > > Anyhow, you might want to report the file_exists as a bug on php.net? I > could do it, but I haven't actually experienced the problem. > > My guess is that it has absolutely nothing to do with RH 7.3, it is > more > likely a problem between php 4.2.3 and apache 2.0.43... but this is > just > a guess! > > take care, > > Waitman Gobble > EMK Design > Buena Park, California > +1.7145222528 > http://emkdesign.com > -- Brett O'Connor Dogheadbone LLC P.O. Box 171 Littleton, CO 80160 Phone: 303.797.2992 AIM: BrettDHB E-Mail: oco...@do... Web: http://www.dogheadbone.com/ |