Page 1 of 1
allow_url_fopen
Posted: 20 Jan 2010, 19:16
by arobert
Hi,
I made my change in my Php.ini to change allow_url_fopen from off to on ...
When i run phpinfo() I can see allow_url_fopen at "on" however when I go into "info" from Phoca Gallery allow_url_fopen appears to be off ...
And what else ; When i go into general infos of my Joomla I have : allow_url_fopen Local value ON and Master value ON
Should I reinstall Phoca in order to detect allow_url_fopen on ?
Re: allow_url_fopen
Posted: 22 Jan 2010, 15:00
by arobert
Hi guys,
Is there a Phoca developper who could check that for me ?
What happen if I uninstall Phoca, do I lose all my data (phoca data I mean) ?
Re: allow_url_fopen
Posted: 23 Jan 2010, 17:34
by arobert
Hi,
Is there any Admin on this server.
I'm looking for any form fo support ... I'm experiencing an serious issue about Phoca and Picasa, and it would be very nice if an developper could tell me what to do ...
Either i reinstall or change something in a file ?! Just tell me what to do, i will !
And if you don't have any clue on this issue just tell me !
Re: allow_url_fopen
Posted: 23 Jan 2010, 22:33
by Jan
Hi, please read the text above the forum. There is only one developer and he cannot be on the internet 24hours a day
I am testing it and get no such problem there. On my localhost it is enabled and I can see it as enabled in Info, on my test server it is disabled and I can see it disabled
In the info site, it is only information, nothing more, so you can try it and you will see if the function is working or not. If the function is disabled, you get an error while retrieving data. Then you will know the function doesn't work on your server.
You need not to reinstall and there is no dependency to this.
Check your cache settings on your server to see if the sent information is displayed correctly.
Jan
Re: allow_url_fopen
Posted: 24 Jan 2010, 14:29
by arobert
Ok i'm gonna try
Thanks for your anwer !
Re: allow_url_fopen
Posted: 27 Feb 2010, 18:27
by arobert
Hi, I have been looking in you code
Here what you do in view.html.php in views/phocagalleryin
Code: Select all
if(ini_get('allow_url_fopen')==0){
$bgStyle = 'style="background:#ffcccc"';
$icon = 'false';
$iconText = JText::_('Disabled');
} else {
$bgStyle = 'style="background:#ccffcc"';
$icon = 'true';
$iconText = JText::_('Enabled');
}
I have been testing this code on a simple test.php
Code: Select all
<?php
echo "<p>ini_get('allow_url_fopen') : ". ini_get('allow_url_fopen')."</p>";
if(ini_get('allow_url_fopen')==0){
echo "<p> allow_url_fopen == 0</p>";
} else {
echo "<p> allow_url_fopen different 0</p>";
}
?>
And here is the result :
ini_get('allow_url_fopen') : On
allow_url_fopen == 0
Then I guess the test ini_get('allow_url_fopen')==0 is wrong ... Could you correct this ? Should I correct it by my self ?
And for your information in PHP this is right :
Code: Select all
if ("string" == 0){
echo "Always true";
}
And to finish :
In the file phocagalleryc.php you did the same mistake
if(ini_get('allow_url_fopen') == 0){
$errorMsg = JText::_('PHOCAGALLERY_PICASA_NOT_LOADED_FOPEN');
return false;
}
Re: allow_url_fopen
Posted: 27 Feb 2010, 21:50
by Jan
Hi, sorry I don't understand, which version of PHP you are running.
On my PHP 5 I get this:
RUN:
Code: Select all
<?php
echo "<p>ini_get('allow_url_fopen') : ". ini_get('allow_url_fopen')."</p>";
if(ini_get('allow_url_fopen')==0){
echo "<p> allow_url_fopen == 0</p>";
} else {
echo "<p> allow_url_fopen different 0</p>";
}
?>
RESULT:
allow_url_fopen enabled:
Code: Select all
ini_get('allow_url_fopen') : 1
allow_url_fopen different 0
allow_url_fopen_disabled:
Code: Select all
ini_get('allow_url_fopen') :
allow_url_fopen == 0
Tested on:
- Windows XP - Apache, PHP5
- FreeBSD - Apache, PHP5
I don't understand how the strings:
if ("string" == 0){
echo "Always true";
}
are related to this problem?
Jan
Re: allow_url_fopen
Posted: 28 Feb 2010, 11:30
by arobert
Hi it's not PHP version depending ...
It's depending on PHP Configuration . For some reason in some Server, value for allow_url_fopen is not 1, 0 or "no value" but "On" or "Off" ...
Then, ini_get('allow_url_fopen') return a String Type value : "On" or "Off" !
And if you read this :
http://www.php.net/manual/en/language.o ... arison.php you see that :
If you compare a number with a string or the comparison involves numerical strings, then each string is converted to a number and the comparison performed numerically.
Then you should anderstand that :
Code: Select all
if ("string" == 0){
echo "Always true";
}
Re: allow_url_fopen
Posted: 28 Feb 2010, 15:52
by Jan
Hi,
I will take a look at it.
Maybe I will implement something like this:
Code: Select all
function ini_get_bool($a)
{
$b = ini_get($a);
switch (strtolower($b))
{
case 'on':
case 'yes':
case 'true':
return 'assert.active' !== $a;
case 'stdout':
case 'stderr':
return 'display_errors' === $a;
default:
return (bool) (int) $b;
}
}
source:
http://php.net/manual/en/function.ini-get.php
to be 100% sure to get boolean.
Jan