d13slideshow for WordPress and "URL file-access is disabled" - php

I'm taking my chances with WordPress 3.0 beta 1 (single user)
Unfortunately, i ran into problems with d13slideshow.
I configured the plugin to display 5 latest from a category, added <?php d13slideshow(); ?> to home.php, but it bombed:
function.getimagesize: URL file-access is disabled in the server configuration in /<snip>/wp-content/plugins/d13slideshow/d13slideshow.php on line 538
Warning: getimagesize(http://<snip>/wp-content/uploads/2010/04/featured-2-580x386.jpg) function.getimagesize: failed to open stream: no suitable wrapper could be found in /<snip>/wp-content/plugins/d13slideshow/d13slideshow.php on line 538
Is this a problem with the php setup or is there something I can do with the plugin or the function call from the template files to make it work?
http://wordpress.org/extend/plugins/d13slideshow/

It seems to be a configuration stuff... you will have to edit your php.ini and change the allow_url_include option from Off to On. For example
# nano /etc/php5/apache2/php.ini
; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
allow_url_include = On
Then, you will have to restart apache:
# /etc/init.d/apache2 restart
You will have to use the correct paths for your server ;)
Tell me if that works...

You may not have access to your php.ini file due to hosting restrictions. Ask you host or check for an update to that plugin.

Related

Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0

I upload my Laravel project on shared hosting. When I upload my project on the server it throws an exception then switched my PHP version 5.4 to 7.4. Now am facing this issue.
Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0
I also disable the allow_url_include in my PHP ini file which exists in project root directory but it still says allow_url_include depreciated error.
Also, I go into the PHP Multi INI Editor and change the allow_url_include but it still throw the above error.
Remove .htaccess or change name to .htaccess.backup and WP will generate new file based on your site configuration
Log into your website host and navigate to your public_html folder and find the php.ini file. Open the file and find this code:
; Whether to allow include/require to open URLs (like http:// or ftp://) as files.
; http://php.net/allow-url-include
allow_url_include = On
Change allow_url_include = On to allow_url_include = Off and save the file.
This should fix the error.
Additional detail located here:
https://www.php.net/manual/en/filesystem.configuration.php#ini.allow-url-include
In case anyone comes across this:
Make sure that .htaccess files at all levels do not have conflicting code.
That is, I found that my ".../public_html/.htaccess" did not have any conflicts. However, I also had an .htaccess file in the folder level above that and it included code that read:
# Use PHP71 as default AddHandler application/x-httpd-php71 .php <IfModule mod_suphp.c> suPHP_ConfigPath /opt/php71/lib </IfModule>
Commenting this out resolved the error for me.
If your web host uses Cpanel, log in and under the Software section click Select PHP Version, then on the next screen click Options. Under Options, unclick allow_url_include:
Please Update PHP version of your site through CPanel to 7.3. This fixed the issue for my site. Thank you!
My client had 2 .ini files, conflicting max_input_var.
Deleting user.ini worked for me! Payment options were greyed out in WooCommerce. Now they are showing and this "allow_url" error is gone.

Double php error: Getting error readfile(): https:// wrapper is disabled etc; error failed to open stream: no suitable wrapper could be found

Recently for no apparent reason the readfile function has stopped working across one of the sites that I manage. The error that I'm getting in the php error logs is:
PHP Warning: readfile(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0 xxxxxxxxxxxxxx
PHP Warning: readfile(https://www.thedomain.com/xxxxx/xxxx/xxxx.php): failed to open stream: no suitable wrapper could be found in xxxxxxxxxxxxxxxxxxxxxxxxx
I have enabled allow_url_fopen and allow_url_include yet it still doesn't work. I have found another solution based on php curl library online and it works but Implementing it across the entire site is tedious as the site is enormous.
I have tried alternatives such as adding "php_value allow_url_fopen On" to the .htaccess file and adding a php.ini with "allow_url_fopen = On" and "allow_url_include = On" file in a few of the directories of pages that aren't working properly.
allow_url_fopen can be changed only in the system level INI file, it can not be changed (i.e., overridden) in a .htaccess file or in a script via ini_set(). See this page for details. You can run a script containing phpinfo(); to discover what INI file your PHP installation is loading. Look for something like:
Loaded Configuration File => /usr/local/etc/php.ini

How to fix PHP Deprecated Automatically populating $HTTP_RAW_POST_DATA is deprecated issue?

hello i'm getting this error in my error log:
"PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0"
My wordpress version is 4.8.1 and the php version is 5.6.30.
I tried fixing the issue by creating a php ini file and setting always_populate_raw_post_data value to -1. But i still get the error.
If it cannot be fixed, how can i prevent it prints on the error log?
I'm using a shared hosting.
how can i prevent it prints on the error log?
Your problem here is not that you cannot access php.ini and it is not that error shows.
Your problem, in fact, is that you use deprecated variable
instead, you could try using
file_get_contents('php://input');
php.ini is located somewhere in the php files on the server, which I assume you have no access to on shared hosting.
The php.ini file you created needs to be located where PHP expects to find its config files. You can see the configs which PHP is already loading using the phpinfo() function:
Upload a file named info.php with the following contents to your web server root:
<?php
// delete this file or comment out the below function when not in use
phpinfo();
?>
Then use a browser to navigate to http://yourwebsite.com/info.php. A page should load which tells you all about your php configuration. Look for the part near the top which shows information about the loaded configuration files. In particular, look for these entries:
"Loaded Configuration File" and "Scan this dir for additional .ini files".
If you have access to the .ini file listed as the Loaded Configuration File simply modify the value for always_populate_raw_post_data there. Otherwise, upload the .ini file you already created to the directory that is scanned for additional configuration files. Of course, you'll need to reload or restart php in order to reparse the configuration files.
If you don't have access to any of the locations listed from the above steps, it's possible your hosting provider may give you access to your php.ini file through cPanel or a similar means. Otherwise, your best bet is to contact them directly.
Finally, if you don't care about the actual configuration value as much as just suppressing the warning message, you could use the ini_set() function to set your error reporting to a different value, eliminating any deprecation warnings. The variable you want to set is "error_reporting" and a list of possible values can be found here.
In addition, since you are running WordPress there are some debug and error reporting options you can set in the wp-config.php file.
If your Account (on the shared hosting) using (or Configured) PHP-FPM, you can't do it via php.ini (if you create php.ini in your root, it will have no effect)
you can try: add this code
<IfModule mod_php5.c>
php_value always_populate_raw_post_data -1
</IfModule>
in your .htaccess file in your root directory, if not helps then ask the server admin (support) to change that in core php.ini globally for the given host.
You cant create a PHP.ini just like that. This is a core config file that is part of the PHP install. http://php.net/manual/en/configuration.file.php Read over this documentation to get a better idea of what the ini does.
The ini file could be located in multiple places depending on the OS and who installed it. If you do not have access to it, talk to your hosting provider

Warning: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0

I seem to have developed a slight issue with one of my plugins and am currently getting this error:
Warning: file_get_contents(): https:// wrapper is disabled in the server configuration by allow_url_fopen=0
The first solution I tried was to change allow_url_fopen to enabled in the server configuration but this didn't solve anything, I then did a test to see if it is actually showing as on and it is.
I even tried adding ini_set("allow_url_fopen", 1); to see if that would solve it but I'm still getting the issue.
Is there something I haven't tried?
Answered my own question here.
I have multiple sites on the same server, so switching it on just a subdomain did nothing. To solve this I had to edit the PHP version in MultiPHP INI Editor.
As per the docs, allow_url_fopen is PHP_INI_SYSTEM, what means:
Entry can be set in php.ini or httpd.conf
This makes sense: the directive is a security feature so users should not be able to override it.
Since ini_set() is PHP code you are not setting it in any of the aforementioned configuration files, which are the only allowed locations.

php include issue - works on one server... not another.. init file?

php "includes" are working fine on my current production server/site. (shared server)
I am moving this site to a new server and "includes" do not work. Error message:
Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/xxxxx/public_html/publications/abss/myfile.php on line 140
In control panel I can set php version from 5.2 to 5.6 and generate init file. When I look at init file I find no "include" option to enable.
Questions:
Why is there no enable option in php.ini file? (I tried both 5.2 and 5.6 versions) Can I manually enter?
Does the php.ini file run each time a page is rendered?
How do I know if php.ini is actually in effect?
Thank you very much.
First of all check
phpinfo()
to see allow_url_fopen" and "allow_url_include" are ON
If not, you need to set them on OR contact your webmaster or hosting provider to enable allow_url_fopen and allow_url_include in the PHP server configuration.
I had tryed "allow_url_include" on but didn't work.
However, when I copied my init file from the old server to the new it worked fine. Not sure why. Didn't do a file compare.

Categories