[PHP] URL file-access disabled
Hi, ho, I have a problem; something which works locally is complaining on the BSD Unix server I use: The Code: (somewhere else I define $image_dir) !-- If there's an image, get it, get its height and width and slap it into an image tag, otherwise, move on -- ?php if (!empty($article['image'])) { $image = ($article['image']); $size1 = getimagesize($image_dir.$image); $width1 = $size1[0]; $height1 = $size1[1]; include_once(INCLUDES . 'image.include.php'); } ? The Include: img class='right-float' src='?php echo $image_dir.$image ?' width='?php echo $width1 ?' height='?php echo $height1 ?' alt='?php echo $image ?' border='0' / The Error: Warning: getimagesize(): URL file-access is disabled in the server configuration in /usr/www/users/user/articles/technology/index.htm on line 180 Warning: getimagesize(http://www.domain.com/images/combination_device.jpg): failed to open stream: no suitable wrapper could be found in /usr/www/users/user/articles/technology/index.htm on line 180 The Question: Anything I can do within .htaccess to make this not happen? I don't have root access or access to php.ini, and they're loathe to change the configuration on a shared servcer. Thanks in advance, Jack -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL file-access disabled
$image_dir is an url (begins with http:// or similar) and allow_url_fopen is off on your BSD. Do you need to access it using url wrappers? If the images are local you can access them using plain filesystem access Jackson Linux wrote: Hi, ho, I have a problem; something which works locally is complaining on the BSD Unix server I use: The Code: (somewhere else I define $image_dir) !-- If there's an image, get it, get its height and width and slap it into an image tag, otherwise, move on -- ?php if (!empty($article['image'])) { $image = ($article['image']); $size1 = getimagesize($image_dir.$image); $width1 = $size1[0]; $height1 = $size1[1]; include_once(INCLUDES . 'image.include.php'); } ? The Include: img class='right-float' src='?php echo $image_dir.$image ?' width='?php echo $width1 ?' height='?php echo $height1 ?' alt='?php echo $image ?' border='0' / The Error: Warning: getimagesize(): URL file-access is disabled in the server configuration in /usr/www/users/user/articles/technology/index.htm on line 180 Warning: getimagesize(http://www.domain.com/images/combination_device.jpg): failed to open stream: no suitable wrapper could be found in /usr/www/users/user/articles/technology/index.htm on line 180 The Question: Anything I can do within .htaccess to make this not happen? I don't have root access or access to php.ini, and they're loathe to change the configuration on a shared servcer. Thanks in advance, Jack -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] URL file-access disabled
My provider has provided me the solution: adding php_flag allow_url_fopen on to the .htaccess Apologies to the list for wasting time and bandwidth. Jack On 31 Mar 2005, at 17:47, Jackson Linux wrote: Hi, ho, I have a problem; something which works locally is complaining on the BSD Unix server I use: The Code: (somewhere else I define $image_dir) !-- If there's an image, get it, get its height and width and slap it into an image tag, otherwise, move on -- ?php if (!empty($article['image'])) { $image = ($article['image']); $size1 = getimagesize($image_dir.$image); $width1 = $size1[0]; $height1 = $size1[1]; include_once(INCLUDES . 'image.include.php'); } ? The Include: img class='right-float' src='?php echo $image_dir.$image ?' width='?php echo $width1 ?' height='?php echo $height1 ?' alt='?php echo $image ?' border='0' / The Error: Warning: getimagesize(): URL file-access is disabled in the server configuration in /usr/www/users/user/articles/technology/index.htm on line 180 Warning: getimagesize(http://www.domain.com/images/combination_device.jpg): failed to open stream: no suitable wrapper could be found in /usr/www/users/user/articles/technology/index.htm on line 180 The Question: Anything I can do within .htaccess to make this not happen? I don't have root access or access to php.ini, and they're loathe to change the configuration on a shared servcer. Thanks in advance, Jack -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php