swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Swftools-common] running PDF2SWF via php on linux issue


From: Mark A. Lowe
Subject: RE: [Swftools-common] running PDF2SWF via php on linux issue
Date: Thu, 28 Aug 2008 11:02:37 +1000

Many thanks Peter and Mattias, chmod 777 recursively the directory worked.

Out of interest, I need to put in the full path to my pdf2swf install directory 
for it to work. E.g:
$output = 
`/var/www/vhosts/example.com.au/httpdocs/pdf2swf/swftools-2008-08-21-2105/src/pdf2swf
 degani.pdf -o degani.swf`;

?How do I make it so I only need to write : $output = `pdf2swf degani.pdf -o 
degani.swf`;

Also, does anyone have any php code, or know where I can get some examples, to 
calculate the number of pages in a pdf and then create an individual swf for 
each page?
Do I just parse the output of `pdf2swf -I degani.pdf` and do a for loop based 
on that?

Cheers,

Mark.


mark lowe
multimedia director
multimedia resource australia
t:
+61 3 9281 3235 
m:
+61 424257967
e:
address@hidden
w:
www.mmr.com.au
 
 MMR, Suite 409, 434 St. Kilda Road, Melbourne, 3004


-----Original Message-----
From: peter kostov [mailto:address@hidden 
Sent: Wednesday, August 27, 2008 7:08 PM
To: Mark A. Lowe
Cc: address@hidden
Subject: Re: [Swftools-common] running PDF2SWF via php on linux issue

Mark A. Lowe wrote:
> Hey guys,
> 
>  
> 
> I've been using PDF2SWF via my command line in Windows for a while now.
> 
> For the last week or so, I've been trying to get it to work via a php script
> on my Linux box.
> 
>  
> 
> It's installed fine, and when I run it via ssh (under the 'root' user) it
> works fine.
> 
> I'm using this simple command, without any extras obviously : pdf2swf
> myPDF.pdf
> 
>  
> 
> I put this same command in a PHP file but was getting no result - no .swf
> file nor response.
> 
> I've now changed it to give the full location of the pdf2swf command, as in:
> 
>  
> 
> <?php
> 
> $output =
> `/var/www/vhosts/mydomain.com.au/httpdocs/pdf2swf/swftools-2008-08-21-2105/s
> rc/pdf2swf myPDF.pdf -o myPDF.swf`;
> 
> echo "Output pdf2swf: <pre>$output</pre>";
> 
> ?>
> 
>  
> 
> This is now giving me the following output:
> 
>  
> 
> NOTICE  processing PDF page 1 (450x600:0:0) (move:0:0)
> 
> NOTICE  Writing SWF file degani.swf
> 
> FATAL   Could not create "degani.swf".
> 
>  
> 
> So it is running fine, but it just can't write out the .swf file.
> 
> I've chmod 777 my php file. 
Hi Mark,
you shouldn't chmod your php file (it should be 755), but instead you 
should chmod recursively 777 the directory where the script will write 
the output file. Or a better solution is to run PHP as CGI script, not 
as Apache module in which case PHP will run on behalf of your user, not 
the Apache server and will have access to all of your files without need 
to chmod them at all.
And if you do not want troubles, please do not do anything (!) as root 
except the system administration (eg. installing/uninstalling 
applications system wide, configuring services, adding/removing users, etc.)
> 
> I've tried to set up a sudoers file like so :
> 
> apache rushmore = NOPASSWD:
> /var/www/vhosts/mydomain.com.au/httpdocs/pdf2swf/swftools-2008-08-21-2105/sr
> c/pdf2swf
> 
> and use "sudo -u apache /var./pdf2swf/. etc" but I get no output.
You don't need sudo/sudoers for this at all.
> 
>  
> 
> So the root user can run it, but my webserver (apache) can't.
> 
> Do I need to change the owner/group of the install  files?
No.
> 
> Do I need to use a sudo command and run it as root?
No.
> 
>  
> 
> Any help with this would be massively appreciated - I'm so close!
> 
>  
> 
> Cheers,
> 
>  
> 
> Mark.
> 
>  
Greetings,
Peter
> 
>   _____  
> 
> 
> mark lowe
> multimedia director
> 
> 
> multimedia resource australia
> 
> 
> t:
> 
> +61 3 9281 3235 
> 
> 
> m:
> 
> +61 424257967
> 
> 
> e:
> 
>  <mailto:address@hidden> address@hidden
> 
> 
> w:
> 
>  <http://www.mmr.com.au/> www.mmr.com.au
> 
>  
> 
>  MMR, Suite 409, 434 St. Kilda Road, Melbourne, 3004
> 
>  
> 
> 


-- 

-------
Boryana & Peter Kostovi,
web design & webdevelopment
home site: http://bgwebdeveloper.com





reply via email to

[Prev in Thread] Current Thread [Next in Thread]