LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > General > [Solved] Failed to create temp file with mkstemp()

Reply
 
Thread Tools Display Modes
  #1  
Old 09-05-2011, 10:52 AM
sophrosyne sophrosyne is offline
Member
 
Join Date: Jul 2011
Location: Michigan
Posts: 15
Default [Solved] Failed to create temp file with mkstemp()

Trying to output a report using the Zend Pdf library throws this error in stderror log:

2011-09-05 13:20:35.444 [STDERR] Failed to create temp file with mkstemp(): Permission denied
2011-09-05 13:20:35.444 [STDERR] Failed to increase temp file size with ftrancate(): Bad file descriptor

This error in the error.log:

2011-09-05 13:45:25.228 [ERROR] [216.234.104.50:50982-0#APVH_207.32.184.195_example.com] Failed to initialize VMemBuf.
2011-09-05 13:45:25.228 [INFO] [216.234.104.50:50982-0#APVH_207.32.184.195_example.com] connection to [/tmp/lshttpd/APVH_demo.example.com_Suphp.sock.480] on request #0, confirmed, 1, associated process: 1011, running: 1, error: Illegal seek!
2011-09-05 13:45:25.228 [NOTICE] [216.234.104.50:50982-0#APVH_207.32.184.195_example.com] oops! 503 Service Unavailable
2011-09-05 13:45:25.228 [NOTICE] [216.234.104.50:50982-0#APVH_207.32.184.195_snowleotards.com] Content len: 74, Request line:
POST /catalog/index.php/admin/sales_order/pdfinvoices/key/e5b2f8a77e012d61aa38d36fef25f6fe/ HTTP/1.1

INFO:

Litespeed Web Server Enterprise v4.0.15

PHP 5.2.17 (cli) (built: Jun 13 2011 14:23:24)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
with eAccelerator v0.9.5.3, Copyright (c) 2004-2006 eAccelerator, by eAccelerator
with the ionCube PHP Loader v4.0.8, Copyright (c) 2002-2011, by ionCube Ltd., and
with Zend Optimizer v3.3.9, Copyright (c) 1998-2009, by Zend Technologies

I checked permissions on /tmp and it's open to all rw. Suggestions on where to look?
Reply With Quote
  #2  
Old 09-05-2011, 07:54 PM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
Code:
~>man mkstemp
MKSTEMP(3)                 Linux Programmer's Manual                MKSTEMP(3)

NAME
       mkstemp - create a unique temporary file

SYNOPSIS
       #include <stdlib.h>

       int mkstemp(char *template);

DESCRIPTION
       The  mkstemp() function generates a unique temporary filename from template.  The last six characters of template must be
       XXXXXX and these are replaced with a string that makes the filename unique. The file is then created with mode read/write
       and  permissions  0666 (glibc 2.0.6 and earlier), 0600 (glibc 2.0.7 and later).  Since it will be modified, template must
       not be a string constant, but should be declared as a character array.  The file is opened with the open(2) O_EXCL  flag,
       guaranteeing that when mkstemp() returns successfully we are the only user.
the error message
Code:
2011-09-05 13:20:35.444 [STDERR] Failed to create temp file with mkstemp(): Permission denied
should be from Zend Pdf library, since it looks mkstemp() is not a php function, but a C function.

it depends on the value of variable "template". assume it's "a.XXXXXX". then temporary file will be created at current working directory, not /tmp/. for more information, please check what user lsphp is running as, and the location of the php scripts and the directory permission.
Reply With Quote
  #3  
Old 09-06-2011, 07:31 AM
sophrosyne sophrosyne is offline
Member
 
Join Date: Jul 2011
Location: Michigan
Posts: 15
Thanks for the reply. What about the following error?

2011-09-04 06:28:22.654 [ERROR] [208.69.120.120:61555-0#APVH_207.32.184.195_example.com] Failed to initialize VMemBuf.
Reply With Quote
  #4  
Old 09-06-2011, 07:45 AM
sophrosyne sophrosyne is offline
Member
 
Join Date: Jul 2011
Location: Michigan
Posts: 15
Also, switching to apache the Pdf outputs as it should. It has to be an lsws/lsapi configuration issue somewhere. Just can't seem to figure out where.

FYI: lsws is running as apache:apache.
Reply With Quote
  #5  
Old 09-06-2011, 08:32 AM
NiteWave NiteWave is offline
LiteSpeed Staff
 
Join Date: Sep 2009
Posts: 2,226
Code:
FYI: lsws is running as apache:apache.
how about lsphp5?

Code:
2011-09-04 06:28:22.654 [ERROR] [208.69.120.120:61555-0#APVH_207.32.184.195_example.com] Failed to initialize VMemBuf.
please refer http://www.litespeedtech.com/support...ead.php?t=4571
Reply With Quote
  #6  
Old 09-06-2011, 08:50 AM
sophrosyne sophrosyne is offline
Member
 
Join Date: Jul 2011
Location: Michigan
Posts: 15
I figured it out. /tmp/lshttpd/swap was not owned by the apache user for some reason. chown'ing to apache fixed the problem.

Thanks for your help.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 06:51 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.