title: how to use XPDF on VPS with Zpanel?
body: <p>I am trying to make a webpage to convert a pdf to text file using xpdf.<br>
  Below is the php code to do it on windows using xampp.</p>
  
  <pre><code>&lt;?php
  $filename = array();
  $filename ="/Applications/XAMPP/xamppfiles/htdocs/abc/test.pdf";//Path of the file
  
  //while ($filename = readdir($dir)) {
  if (eregi("\.pdf",$filename)){
  
  $content  = shell_exec('/usr/local/bin/pdftotext -raw'.' '.$filename.' -');//$content stores the content of the pdf as string
  
  
  
  $read =basename($filename,".pdf");//extracting file name 
  $testfile = "$read.txt";//changing extension of filename
  $file     = fopen("/Applications/XAMPP/xamppfiles/htdocs/".$testfile,"w");// creates new file of the same name in at the given location
  fwrite($file, $content);//writes content to file
  if (filesize($testfile)==0){} //checks if file null
  else{
  $text = fread($file,filesize($testfile));
  fclose($file);
  echo "&lt;/br&gt;"; echo "&lt;/br&gt;";
  }
  }?&gt;
  </code></pre>
  
  <p>Now i want to run it on linux VPS.<br>
  I have a Cent OS VPS with SSH access. I have installed zpanel, xpdf (using yum install xpdf).<br>
  Now i want, when i open this URL "www.website.com/convert.php" in browser, the test.pdf file in public_html folder should convert to test.txt in same folder.</p>
  
  <p>So, what code should i write in convert.php?</p>