Just transfered my installation to a new server. I'm having trouble debugging this, to my knowledge all permissions are still identical or MORE open than my old server on the folders that the server creates/reads files in...
From all I can tell, it's just that a temp file can't be created somewhere, but I have no idea where...
Warning: tempnam() [function.tempnam]: open_basedir restriction in effect. File() is not within the allowed path(s): (/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/myacnt/public_html/users/internal/PHPExcel/Writer/Excel5/Worksheet.php on line 346
Warning: fopen() [function.fopen]: Filename cannot be empty in /home/myacnt/public_html/users/internal/PHPExcel/Writer/Excel5/Worksheet.php on line 347
Warning: tempnam() [function.tempnam]: open_basedir restriction in effect. File() is not within the allowed path(s): (/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/myacnt/public_html/users/internal/PHPExcel/Writer/Excel5/Worksheet.php on line 346
Warning: fopen() [function.fopen]: Filename cannot be empty in /home/myacnt/public_html/users/internal/PHPExcel/Writer/Excel5/Worksheet.php on line 347
Warning: tempnam() [function.tempnam]: open_basedir restriction in effect. File() is not within the allowed path(s): (/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/myacnt/public_html/users/internal/PHPExcel/Writer/Excel5/Worksheet.php on line 346
Warning: fopen() [function.fopen]: Filename cannot be empty in /home/myacnt/public_html/users/internal/PHPExcel/Writer/Excel5/Worksheet.php on line 347
Warning: tempnam() [function.tempnam]: open_basedir restriction in effect. File() is not within the allowed path(s): (/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/myacnt/public_html/users/internal/PHPExcel/Shared/OLE/OLE_File.php on line 95
Warning: fopen() [function.fopen]: Filename cannot be empty in /home/myacnt/public_html/users/internal/PHPExcel/Shared/OLE/OLE_File.php on line 96
Fatal error: Uncaught exception 'Exception' with message 'Can't create temporary file' in /home/myacnt/public_html/users/internal/PHPExcel/Shared/OLE/OLE_File.php:98 Stack trace: #0 /home/myacnt/public_html/users/internal/PHPExcel/Writer/Excel5.php(190): PHPExcel_Shared_OLE_PPS_File->init() #1 /home/myacnt/public_html/users/functions/export.php(58): PHPExcel_Writer_Excel5->save('/home/myacnt/...') #2 /home/myacnt/public_html/users/manager/functions/export.php(196): multiCSVToExcel(Array, '1305481112_Nick...') #3 /home/myacnt/public_html/users/manager/viewInvoice.php(13): exportInvoiceLog(Array) #4 {main} thrown in /home/myacnt/public_html/users/internal/PHPExcel/Shared/OLE/OLE_File.php on line 98
You're dealing with a restriction called open_basedir as indicated by your error message. You either have to check the value in php.ini (you can use phpinfo() to check this quickly) and put files in the directory indicated, modify the value, or simply disable it entirely. If you disable it, you'll need to make sure to do sanity checks on filenames, such as using basename to remove potential "../../" traversal.
This fix worked for me:
http://phpexcel.codeplex.com/workitem/17840
The changes must be applied to Shared/File.php
Related
Getting the following warning message in Grunt.js:
Warning: Unable to write "filepath" file (Error code: EPERM). Use --force to continue.
Aborted due to warnings.
Process terminated with code 3.
To solve this error, remove the Read-only property from the parent folder's Properties.
I have never used PHP and need it just to build my WordPress site with an installed theme.
Every time when I open any pages under my wp-admin, I'm getting a warning:
Warning: include_once(): Failed opening
‘/myURL/public_html/wp-content/plugins/dsidxpress/admin.php’
for inclusion (include_path=’.:/usr/local/php56/pear’) in
/myURL/public_html/wp-content/plugins/dsidxpress123/dsidxpress.php
on line 90
When opening .php, I see the following code on line 90:
include_once(str_replace("\\", "/", WP_PLUGIN_DIR) . "/dsidxpress/admin.php");
After changing it per the instrucions:
include_once(include_path='.:/usr/local/php56/pear' . “/dsidxpress/admin.php”);
I'm getting new error:
Parse error: syntax error, unexpected ‘=’ in /myURL/public_html/wp-content/plugins/dsidxpress123/dsidxpress.php on line 90
How exactly do I need to change it?
I am having the following issue in wp site.
Warning: include(/home2/ngohost/public_html/artfinteriors.com/wp-content/plugins/wp-super-cache/wp-cache-base.php): failed to open stream: No such file or directory in /home/ngohost/public_html/artfinteriors.com/wp-content/plugins/wp-super-cache/wp-cache.php on line 65
Warning: include(): Failed opening '/home2/ngohost/public_html/artfinteriors.com/wp-content/plugins/wp-super-cache/wp-cache-base.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ngohost/public_html/artfinteriors.com/wp-content/plugins/wp-super-cache/wp-cache.php on line 65
Warning: include_once(/home2/ngohost/public_html/artfinteriors.com/wp-content/plugins/wp-super-cache/ossdl-cdn.php): failed to open stream: No such file or directory in /home/ngohost/public_html/artfinteriors.com/wp-content/plugins/wp-super-cache/wp-cache.php on line 82
Warning: include_once(): Failed opening '/home2/ngohost/public_html/artfinteriors.com/wp-content/plugins/wp-super-cache/ossdl-cdn.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/ngohost/public_html/artfinteriors.com/wp-content/plugins/wp-super-cache/wp-cache.php on line 82
Warning: Cannot modify header information - headers already sent by (output started at /home/ngohost/public_html/artfinteriors.com/wp-content/plugins/wp-super-cache/wp-cache.php:65) in /home/ngohost/public_html/artfinteriors.com/wp-includes/pluggable.php on line 1179
It seems that you are using WP Super Cache plugin and this is causing the errors. The first step for debugging is to try to deactivate / uninstall the plugin and see if the error still appear.
My include() works via include(bloginfo('template_directory') . '/home_bloc_horaires.php'); (although this displays the path on the screen which I obviously don't want).
However include(get_stylesheet_directory_uri().'/home_bloc_horaires.php'); fails and yields errors:
Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in D:\EasyPHP\www\wordpress\wp-content\themes\mmt-2014\header.php on line 348
Warning: include(http://127.0.0.1/wordpress/mirail/wp-content/themes/mmt-2014/home_bloc_horaires.php): failed to open stream: no suitable wrapper could be found in D:\EasyPHP\www\wordpress\wp-content\themes\mmt-2014\header.php on line 348
Warning: include(): Failed opening 'http://127.0.0.1/wordpress/mirail/wp-content/themes/mmt-2014/home_bloc_horaires.php' for inclusion (include_path='.;C:\php\pear') in D:\EasyPHP\www\wordpress\wp-content\themes\mmt-2014\header.php on line 348
Yet, echo get_stylesheet_directory_uri().'/home_bloc_horaires.php'; displays a valid, functional path. Any explanation?
Use get_stylesheet_directory() instead of get_stylesheet_directory_uri().
get_stylesheet_directory() returns the directory path(File System Path) .
get_stylesheet_directory_uri() returns URI of directory(Web path)
Followng accepted answers given here I used the following to call some PHP code on my home page:
require_once (bloginfo('template_directory') . '/home_bloc_horaires.php');
It works, but it also actually displays the path of my template directory on my page! Any way to avoid this?
EDIT:
Tried require_once(get_template_directory().'/home_bloc_horaires.php'); : it doesn't work and I get the following error messages:
Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in D:\EasyPHP\www\wordpress\wp-content\themes\mmt-2014\header.php on line 348
Warning: include(http://127.0.0.1/wordpress/mirail/wp-content/themes/mmt-2014/home_bloc_horaires.php): failed to open stream: no suitable wrapper could be found in D:\EasyPHP\www\wordpress\wp-content\themes\mmt-2014\header.php on line 348
Warning: include(): Failed opening 'http://127.0.0.1/wordpress/mirail/wp-content/themes/mmt-2014/home_bloc_horaires.php' for inclusion (include_path='.;C:\php\pear') in D:\EasyPHP\www\wordpress\wp-content\themes\mmt-2014\header.php on line 348
bloginfo() outputs the result, which is why you can see it. Use this instead:
require_once(get_template_directory().'/home_bloc_horaires.php');
You can find more info on loading files in WordPress here.