allow_url_fopen
-
arobert
- Phoca Newbie

- Posts: 6
- Joined: 20 Jan 2010, 19:12
allow_url_fopen
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 ?
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 ?
-
arobert
- Phoca Newbie

- Posts: 6
- Joined: 20 Jan 2010, 19:12
Re: allow_url_fopen
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) ?
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) ?
-
arobert
- Phoca Newbie

- Posts: 6
- Joined: 20 Jan 2010, 19:12
Re: allow_url_fopen
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 !
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 !
- Jan
- Phoca Hero

- Posts: 49297
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: allow_url_fopen
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
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
If you find Phoca extensions useful, please support the project
-
arobert
- Phoca Newbie

- Posts: 6
- Joined: 20 Jan 2010, 19:12
Re: allow_url_fopen
Ok i'm gonna try 
Thanks for your anwer !
Thanks for your anwer !
-
arobert
- Phoca Newbie

- Posts: 6
- Joined: 20 Jan 2010, 19:12
Re: allow_url_fopen
Hi, I have been looking in you code
Here what you do in view.html.php in views/phocagalleryin
I have been testing this code on a simple test.php
And here is the result :
And for your information in PHP this is right :
And to finish :
In the file phocagalleryc.php you did the same mistake
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');
}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>";
}
?>Then I guess the test ini_get('allow_url_fopen')==0 is wrong ... Could you correct this ? Should I correct it by my self ?ini_get('allow_url_fopen') : On
allow_url_fopen == 0
And for your information in PHP this is right :
Code: Select all
if ("string" == 0){
echo "Always true";
}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;
}
- Jan
- Phoca Hero

- Posts: 49297
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: allow_url_fopen
Hi, sorry I don't understand, which version of PHP you are running.
On my PHP 5 I get this:
RUN:
RESULT:
allow_url_fopen enabled:
allow_url_fopen_disabled:
Tested on:
- Windows XP - Apache, PHP5
- FreeBSD - Apache, PHP5
I don't understand how the strings:
Jan
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>";
}
?>allow_url_fopen enabled:
Code: Select all
ini_get('allow_url_fopen') : 1
allow_url_fopen different 0Code: Select all
ini_get('allow_url_fopen') :
allow_url_fopen == 0- Windows XP - Apache, PHP5
- FreeBSD - Apache, PHP5
I don't understand how the strings:
are related to this problem?if ("string" == 0){
echo "Always true";
}
Jan
If you find Phoca extensions useful, please support the project
-
arobert
- Phoca Newbie

- Posts: 6
- Joined: 20 Jan 2010, 19:12
Re: allow_url_fopen
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 :
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 :
Then you should anderstand 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.
Code: Select all
if ("string" == 0){
echo "Always true";
}- Jan
- Phoca Hero

- Posts: 49297
- Joined: 10 Nov 2007, 18:23
- Location: Czech Republic
- Contact:
Re: allow_url_fopen
Hi,
I will take a look at it.
Maybe I will implement something like this:
source: http://php.net/manual/en/function.ini-get.php
to be 100% sure to get boolean.
Jan
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;
}
}
to be 100% sure to get boolean.
Jan
If you find Phoca extensions useful, please support the project