I'm processing a large number of zips and can't track down an error.
The problem is that after the import script runs for a while it suddenly stops with an error at a random zip file. If I try to re-run the script for only that single file, it works (so I exclude that the zip is faulty).
The process is like this: Open zip archive, read content, copy images from the zip, close archive.
I have two questions:
1. Why doesn't PHP simply return false instead of throwing the following error:
PHP Error[2]: copy(zip:///path/to/file/319759.zip#nwh1131_1.jpg): failed to open stream: operation failed
Any ideas what the cause can be? Maybe something with the filesystem? (Server is running on Debian 7 wheezy)
Thanks
Related
I've updated my mediawiki from 1.26.2 to 1.27, the installation process finished ok, but when I try to access I received this error:
Warning:
require(/var/app/current/includes/specials/SpecialUserLogin.php):
failed to open stream: No such file or directory in
/var/app/current/includes/AutoLoader.php on line 81 Fatal error:
require(): Failed opening required
'/var/app/current/includes/specials/SpecialUserLogin.php'
(include_path='/var/app/current/vendor/pear/pear_exception:/var/app/current/vendor/pear/console_getopt:/var/app/current/vendor/pear/pear-core-minimal/src:/var/app/current/vendor/pear/mail_mime:/var/app/current/vendor/pear/mail_mime-decode:/var/app/current/vendor/pear/net_socket:/var/app/current/vendor/pear/net_smtp:/var/app/current/vendor/pear/mail:.:/usr/share/pear:/usr/share/php')
in /var/app/current/includes/AutoLoader.php on line 81
I have no idea why is this happening. If I check the files in my server they're there. I'm also having template issues if I choose vector I only get a messed up template, without styling.
I'm using PHP 5.6.
I hope someone can help me.
I just stumbled across this same exact error after upgrading to MW 1.27.
In my case, the SpecialUserlogin.php existed and all of the permissions were right BUT the word login was written in lowercase so the system thought this file didn't exist. So I just renamed the SpecialUserlogin.php to SpecialUserLogin.php and b00m, it worked!
As for your templating issues, check the common.css file. Copy paste everything out of there, so it's empty, if you don't use it. And check that you're calling your style files correctly in your template.
So I have a script that updates all currency rates for my webshop.
I am trying to have it run using a cronjob but when it's executed through a cronjob I get this error:
PHP Warning: require(.../.../core/dbcon.php): failed to open stream: No such file or directory in /var/www/domain.com/wholesale/system/labs/cur.php on line 2
PHP Fatal error: require(): Failed opening required '.../.../core/dbcon.php' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/domain.com/wholesale/system/labs/cur.php on line 2
I've also tried using the full link to include it but that seems to not work when running it manually and will also not work in cronjobs.
In the php file itself this is what I use to include it:
require(".../.../core/dbcon.php");
And when I manually run it, it returns all the currencies right, and updates them in the database.
How would I correctly require the file so it can execute using a cronjob and manually as well.
Try require("./../../core/dbcon.php");
or use absolute paths.
UPDATE
Answer has been updated - see comments below for more info.
I've got a fairly simple cron job that pulls down some files from an FTP server - none of the files are particularly large, but I'm constantly getting the following:
Connected to voip.colefabrics.com, for user colefabrics\absolute
Warning: ftp_get(): Opening BINARY mode data connection. in /home/www/colefabrics.com/httpdocs/libs/classes/class.ftpObj.php on line 56
There was a problem while downloading website/items.csv
Attempt 2:
Connected to voip.colefabrics.com, for user colefabrics\absolute
Warning: ftp_get(): Opening BINARY mode data connection. in /home/www/colefabrics.com/httpdocs/libs/classes/class.ftpObj.php on line 56
There was a problem while downloading website/items.csv
...snip...
I've been through all the other posts relating to this, tried to enforce passive mode, increased the timeout, but nothing is working.
Does anyone know what might be causing this, and what I can do to try and resolve it?
To confirm, it's working fine via a 'normal' FTP client, it's only via PHP that I have a problem.
I'm incredibly frustrated as I can't seem to get past this error, no matter how I try.
My website requires I download a large (zipped) XML product feed - daily. The file size is variable; I get PHP warnings when the product feed is larger. There MUST be a way to resolve this!
The script downloads the file (still zipped) to my server:
<?php
file_put_contents('datafeed.xml.gz', file_get_contents('http://external website.com/format/xml/compression/gzip/'));
Error: PHP Warning: file_get_contents(...): failed to open stream:
HTTP request failed! in... etc.
How do I solve this? Much appreciated!
I'm trying to check when the file on external server was edited last time.
The function filemtime() doesn't work and throws an exception.
Warning: filemtime() [function.filemtime]: stat failed for
http://examplesite.com/export/export.php?username=***&passwd=***&fileType=xml
I think the problem is in the link, because it's not a direct link to the file but to a php script. Does anybody knows how to get around it and get filetime without downloading that file?