11

When trying to open a file using this command:

$fd = fopen('majestic_files/majestic_record.txt','w');

I get the following error message:

<b>Warning</b>:  fopen(majestic_files/majestic_record.txt) [<a href='function.fopen'>function.fopen</a>]: failed to open stream: Operation now in progress in

What does it mean, and how do I fix it?

Benubird
  • 18,551
  • 27
  • 90
  • 141
  • This won't tell you too terribly much, but hopefully it's a start: http://www.google.com/codesearch?hl=en&lr=&q=%22Operation+now+in+progress%22+php&sbtn=Search – Frank Farmer Jun 02 '11 at 20:52
  • What platform does that execute on? Could it have asked (for example) for retrieval of the file from an archive tape? – wallyk Jun 02 '11 at 21:07
  • @wallyk it's a php script running on linux, on a perfectly ordinary server, such as any website might be hosted on – Benubird Jun 02 '11 at 22:46
  • I change the name and file name of the class. `composer dump autoload` fixed the problem. – Rolly Jun 05 '18 at 17:45

5 Answers5

26

Not directly related to the question of the OP, but if you are getting this error using the Laravel framework (or any other project using composer), chances are that the autoloader can't find one of the classes. For example this tends to happen if you move a class to a different directory without dumping the autoloader.

To fix this, try composer dumpautoload.

Lupinity Labs
  • 2,099
  • 1
  • 15
  • 23
12

This occurs when there is an outstanding blocking operation.

In this context, the error implies that another process has a lock on the file, most likely due to the file being open and written to by whichever process holds the lock.

Jon Cram
  • 16,609
  • 24
  • 76
  • 107
0

I encountered this "failed to open stream: Operation now in progress" error after accidentally passing just a path, rather than a full path & filename, to parse_ini_file.

Nate
  • 1,442
  • 14
  • 22
0

I got this error message when trying to connect to an invalid local IP address. Correcting the host I was connecting to resolved the issue

Kyle Redfearn
  • 2,172
  • 16
  • 34
-4

I think you have to add the "/" at the beginning of the file string ... just an idea with no guarantee

Sascha
  • 1