fwrite() error, operation not permitted - php

Basically, my code should work because it works when I run the website locally. Though, when I upload it to the dedicated server, it will show these errors:
Notice: fwrite(): send of 15 bytes failed with errno=1 Operation not permitted
in /home/advancegzw/www/folder/include/SampQueryAPI.php on line 72
Notice: fwrite(): send of 15 bytes failed with errno=1 Operation not
permitted in /home/advancegzw/www/folder/include/SampQueryAPI.php on
line 72
Notice: fwrite(): send of 15 bytes failed with errno=1 Operation not
permitted in /home/advancegzw/www/folder/include/SampQueryAPI.php on
line 72
Line 72 is fwrite() obviously:
fwrite($this->rSocket, $sPacket);
Is there a possibility that the hosting company blocked outgoing UDP? Or is there another cause?

Related

Warning and Fatal Error on Wordpress Website with Woocommerce

I am getting some weird errors on my wordpress website today even though I haven't installed/updated any plugin etc. So far I have tried disabling all the plugins, changing themes and even checked permission for wordpress folders and files.
Everything looks good. I have even updated PHP version for my website from 5.6 to 7.0 and increased the update file limit from 8MB to 16 MB as suggested on wordpress but nothing has worked. These are the following errors that I am getting.
On My-Admin Page
careeing/public_html/oldbookdepot.in/wp-content/themes/twentyfourteen/functions.php): failed to open stream: Permission denied in
/home/careeing/public_html/oldbookdepot.in/wp-settings.php on line 425
Warning: include(): Failed opening
'/home/careeing/public_html/oldbookdepot.in/wp-content/themes/twentyfourteen/functions.php'
for inclusion (include_path='.:/opt/alt/php70/usr/share/pear') in
/home/careeing/public_html/oldbookdepot.in/wp-settings.php on line 425
On Manage Themes Page in My Admin
Warning:
include(/home/careeing/public_html/oldbookdepot.in/wp-content/themes/twentyfourteen/functions.php): failed to open stream: Permission denied in
/home/careeing/public_html/oldbookdepot.in/wp-settings.php on line 425
Warning: include(): Failed opening
'/home/careeing/public_html/oldbookdepot.in/wp-content/themes/twentyfourteen/functions.php'
for inclusion (include_path='.:/opt/alt/php70/usr/share/pear') in
/home/careeing/public_html/oldbookdepot.in/wp-settings.php on line 425
Warning: An unexpected error occurred. Something may be wrong with
WordPress.org or this server’s configuration. If you continue to have
problems, please try the support forums. (WordPress could not
establish a secure connection to WordPress.org. Please contact your
server administrator.) in
/home/careeing/public_html/oldbookdepot.in/wp-includes/update.php on
line 499
On the home page of website
Warning:
include(/home/careeing/public_html/oldbookdepot.in/wp-content/themes/twentyfourteen/functions.php): failed to open stream: Permission denied in
/home/careeing/public_html/oldbookdepot.in/wp-settings.php on line 425
Warning: include(): Failed opening
'/home/careeing/public_html/oldbookdepot.in/wp-content/themes/twentyfourteen/functions.php'
for inclusion (include_path='.:/opt/alt/php70/usr/share/pear') in
/home/careeing/public_html/oldbookdepot.in/wp-settings.php on line 425
Fatal error: Uncaught Error: Call to undefined function
twentyfourteen_has_featured_posts() in
/home/careeing/public_html/oldbookdepot.in/wp-content/themes/twentyfourteen/page.php:19
Stack trace: #0
/home/careeing/public_html/oldbookdepot.in/wp-includes/template-loader.php(74):
include() #1
/home/careeing/public_html/oldbookdepot.in/wp-blog-header.php(19):
require_once('/home/careeing/...') #2
/home/careeing/public_html/oldbookdepot.in/index.php(17):
require('/home/careeing/...') #3 {main} thrown in
/home/careeing/public_html/oldbookdepot.in/wp-content/themes/twentyfourteen/page.php
on line 19

broken command line while using tinker in laravel

what is the cause of the error?
following my error messages :
ErrorException with message 'streamselect(): unable to select [4]: Interrupted system call (maxfd=9)'
[root#localhost ]# E
Exit: Ctrl+D
PHP Notice: fwrite(): send of 1270 bytes failed with errno=32 Broken pipe in /laravel_path/vendor/psy/psysh/src/Psy/ExecutionLoop/ForkingLoop.php on line 83

Fatal error: Call to undefined function geoip_open()

all goes well suddenly i dont know why a fatal error occurred can any one please tell me the solution ???
Warning: include(lang.php) [function.include]: failed to open stream: Operation not permitted in /var/httpdocs/dev52/include.php on line 59
Warning: include() [function.include]: Failed opening 'lang.php' for inclusion (include_path='.:') in /var/httpdocs/dev52/include.php on line 59
Warning: include(lang2.php) [function.include]: failed to open stream: Operation not permitted in /var/httpdocs/dev52/include.php on line 61
Warning: include() [function.include]: Failed opening 'lang2.php' for inclusion (include_path='.:') in /var/httpdocs/dev52/include.php on line 61
Warning: include_once(inc.php) [function.include-once]: failed to open stream: Operation not permitted in /var/httpdocs/dev52/include.php on line 265
Warning: include_once() [function.include]: Failed opening 'inc.php' for inclusion (include_path='.:') in /var/httpdocs/dev52/include.php on line 265
Fatal error: Call to undefined function geoip_open() in /var/httpdocs/dev52/include.php on line 266
I would suggest you contact your webhost. If everything was working and it suddenly stops working, especially on a widely-used package like phpMyAdmin, it's more than likely someone changed a configuration setting and screwed it up.
If this doesn't help, or if you own the server yourself, try reinstalling phpMyAdmin.
This sometimes happens with nested includes, check to see if there are any include(); statements in lang.php and if so then include these files directly.

Resolving errors in PHP script with large execution time

I have implemented a web crawler that crawls and retrieves content from .edu TLD. The html content is being inserted into MySQL tables as the source code of the page. The script can go on for hours on a decent internet connection when a large number of seed urls are fed to the crawler. Now, my problem is that the script halts after crawling a number of links without giving any errors. I have used exception handling to handle "MySQL Server has gone away error" and has already eliminated a lot of problems and implemented if conditions that echo the errors if they are encountered. However I am not getting any errors. The problem is the halting of the script, whether I run it in the browser, Eclipse PDT or the CLI. Though it is worthy to note that the number of links crawled are somewhat different in all the three methods of running the script. I have altered the php.ini max_execution_time and other directives but this is not helping in anyway.
I have coded the script so that it resumes the crawling from where it halted, but I want the script to continue without halting so that I don't have to monitor whether the script is running or not.
Should I make changes to my Apache httpd.conf files. If yes, then what those settings should be??
The description in these links for my web crawler may help.
Errors regarding Web Crawler in PHP
Solving "MySQL server has gone away" errors
This is the code that retrieves html from url. This is from simple_html_dom.
function file_get_html($url, $use_include_path = false, $context=null, $offset = -1, $maxLen=-1, $lowercase = true, $forceTagsClosed=true, $target_charset = DEFAULT_TARGET_CHARSET, $stripRN=true, $defaultBRText=DEFAULT_BR_TEXT)
{
// We DO force the tags to be terminated.
$dom = new simple_html_dom(null, $lowercase, $forceTagsClosed, $target_charset, $defaultBRText);
// For sourceforge users: uncomment the next line and comment the retreive_url_contents line 2 lines down if it is not already done.
$contents = file_get_contents($url, $use_include_path, $context, $offset);
// Paperg - use our own mechanism for getting the contents as we want to control the timeout.
// $contents = retrieve_url_contents($url);
if (empty($contents))
{
return false;
}
// The second parameter can force the selectors to all be lowercase.
$dom->load($contents, $lowercase, $stripRN);
return $dom;
}
Here is the error log for the following links:
http://www.nust.edu.pk/
http://www.harvard.edu/
http://berkeley.edu/
http://www.columbia.edu/
http://www.princeton.edu/main
http://www.stanford.edu/
And the crawler stopped after crawling this link:
http://itunes.columbia.edu/m/
[01-Jan-2012 22:54:39] PHP Warning: file_get_contents() [streams.crypto]: this stream does not
support SSL/crypto in
D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line 72
[01-Jan-2012 22:54:39] PHP Warning:
file_get_contents(http://lms.nust.edu.pk) [function.file-get-contents]:
failed to open stream: Cannot connect to HTTPS server through proxy in
D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line 72
[01-Jan-2012 22:54:41] PHP Warning:
file_get_contents(http://www.nust.edu.pk/#) [function.file-get-contents]:
failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request
in D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line
72
... (same error repeated twice) ...
[01-Jan-2012 22:55:58] PHP Warning:
file_get_contents(http://www.nust.edu.pk/usr/oricdic.aspx#ipo) [function.file-get-contents]:
failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request
in D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line
72
[01-Jan-2012 22:55:58] PHP Warning:
file_get_contents(http://www.nust.edu.pk/usr/oricdic.aspx#tto) [function.file-get-contents]:
failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request
in D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line
72
[01-Jan-2012 22:55:59] PHP Warning:
file_get_contents(http://www.nust.edu.pk/usr/oricdic.aspx#ilo) [function.file-get-contents]:
failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request
in D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line
72
[01-Jan-2012 22:55:59] PHP Warning:
file_get_contents(http://www.nust.edu.pk/usr/oricdic.aspx#mco) [function.file-get-contents]:
failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request
in D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line
72
[01-Jan-2012 22:56:05] PHP Warning:
file_get_contents(http://www.nust.edu.pk/#) [function.file-get-contents]:
failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request
in D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line
72
... (same error repeated 18 times) ...
[01-Jan-2012 22:57:33] PHP Warning:
file_get_contents(http://www.nust.edu.pk/#ctl00_SiteMapPath1_SkipLink)
[function.file-get-contents]:
failed to open stream: HTTP request failed! HTTP/1.1 400 Bad Request
in D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line
72
[01-Jan-2012 22:57:33] PHP Notice: Undefined variable: parts in
D:\wamp\www\crawler1\AbsoluteUrl\url_to_absolute.php on line 330
[01-Jan-2012 22:57:55] PHP Warning:
file_get_contents(http://www.harvard.edu/#skip) [function.file-get-contents]:
failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line
72
[01-Jan-2012 22:58:21] PHP Warning:
file_get_contents(http://www.harvard.edu/admissions-aid#undergrad) [function.file-get-contents]:
failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line
72
[01-Jan-2012 22:58:22] PHP Warning:
file_get_contents(http://www.harvard.edu/admissions-aid#grad) [function.file-get-contents]:
failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line
72
[01-Jan-2012 22:58:24] PHP Warning:
file_get_contents(http://www.harvard.edu/admissions-aid#continue) [function.file-get-contents]:
failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line
72
[01-Jan-2012 22:58:25] PHP Warning:
file_get_contents(http://www.harvard.edu/admissions-aid#summer) [function.file-get-contents]:
failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line
72
[01-Jan-2012 23:00:04] PHP Warning:
file_get_contents(http://www.harvard.edu/#) [function.file-get-contents]:
failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found
in D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line
72
... (same error repeated 1 time) ...
[01-Jan-2012 23:00:11] PHP Notice: Undefined variable: parts in
D:\wamp\www\crawler1\AbsoluteUrl\url_to_absolute.php on line 330
[01-Jan-2012 23:00:41] PHP Warning: file_get_contents() [streams.crypto]: this stream does not
support SSL/crypto in
D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line 72
[01-Jan-2012 23:00:41] PHP Warning:
file_get_contents(http://directory.berkeley.edu) [function.file-get-contents]:
failed to open stream: Cannot connect to HTTPS server through proxy in
D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line 72
[01-Jan-2012 23:00:47] PHP Notice: Undefined variable: parts in
D:\wamp\www\crawler1\AbsoluteUrl\url_to_absolute.php on line 330
[01-Jan-2012 23:01:53] PHP Warning: file_get_contents() [streams.crypto]: this stream does not
support SSL/crypto in
D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line 72
[01-Jan-2012 23:01:53] PHP Warning:
file_get_contents(http://students.berkeley.edu/uga/) [function.file-get-contents]:
failed to open stream: Cannot connect to HTTPS server through proxy in
D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line 72
[01-Jan-2012 23:01:57] PHP Warning: file_get_contents() [streams.crypto]: this stream does not
support SSL/crypto in
D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line 72
[01-Jan-2012 23:01:57] PHP Warning:
file_get_contents(http://publicservice.berkeley.edu/) [function.file-get-contents]:
failed to open stream: Cannot connect to HTTPS server through proxy in
D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line 72
[01-Jan-2012 23:02:00] PHP Warning: file_get_contents() [streams.crypto]: this stream does not
support SSL/crypto in
D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line 72
[01-Jan-2012 23:02:00] PHP Warning:
file_get_contents(http://students.berkeley.edu/osl/leadprogs.asp) [function.file-get-contents]:
failed to open stream: Cannot connect to HTTPS server through proxy in
D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line 72
[01-Jan-2012 23:02:17] PHP Notice: Undefined variable: parts in
D:\wamp\www\crawler1\AbsoluteUrl\url_to_absolute.php on line 330
[01-Jan-2012 23:02:25] PHP Warning: file_get_contents() [streams.crypto]: this stream does not
support SSL/crypto in
D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line 72
[01-Jan-2012 23:02:25] PHP Warning:
file_get_contents(http://bearfacts.berkeley.edu/bearfacts) [function.file-get-contents]:
failed to open stream: Cannot connect to HTTPS server through proxy in
D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line 72
[01-Jan-2012 23:02:28] PHP Warning: file_get_contents() [streams.crypto]: this stream does not
support SSL/crypto in
D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line 72
[01-Jan-2012 23:02:28] PHP Warning:
file_get_contents(http://career.berkeley.edu/) [function.file-get-contents]:
failed to open stream: Cannot connect to HTTPS server through proxy in
D:\wamp\www\crawler1\simplehtmldom_1_5\simple_html_dom.php on line 72
And this is the error log from php-cgi.exe:
Problem signature:
Problem Event Name: APPCRASH
Application Name: php-cgi.exe
Application Version: 5.3.8.0
Application Timestamp: 4e537939
Fault Module Name: php5ts.dll
Fault Module Version: 5.3.8.0
Fault Module Timestamp: 4e537a04
Exception Code: c0000005
Exception Offset: 0000c793
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 1033
Additional Information 1: 0a9e
Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
Additional Information 3: 0a9e
Additional Information 4: 0a9e372d3b4ad19135b953a78882e789
Please help me in this regard.
you should check call stack of php process (if running as CGI or CLI) or apache httpd process(if run as mod_php).
Then you will see in which module/procedure are execution halted.
Also you can check active TCP/IP connection made by your script, maybe there is some ongoing IO operation which caused your script to halted.
I hope this helps.

PHP connect to serial Comm

How might php can connect to serial Comm?
I try use a class php_serial.class.php but that does not work, when I run the web, error occurs
Warning: Specified serial port is not valid in D:\POS\AppServ\www\Eri\ulikan\phptoserial\gagal\php_serial.class.php on line 111
Warning: The device must be set before to be open in D:\POS\AppServ\www\Eri\ulikan\phptoserial\gagal\php_serial.class.php on line 137
Warning: Device must be opened in D:\POS\AppServ\www\Eri\ulikan\phptoserial\gagal\php_serial.class.php on line 541
Warning: Device must be opened to read it in D:\POS\AppServ\www\Eri\ulikan\phptoserial\gagal\php_serial.class.php on line 474
Warning: Unable to set the baud rate : the device is either not set or opened in D:\POS\AppServ\www\Eri\ulikan\phptoserial\gagal\php_serial.class.php on line 204

Categories