Note that there are some explanatory texts on larger screens.

plurals
  1. POChange in Server Permits script not to work. Can this be due to PHP.ini being different?
    text
    copied!<p>Here is proof that my site is not portable. I had some regex that worked perfectly on my old server. I have now transferred my site to a new server and it doesn't work.</p> <pre><code>$handle = popen('/usr/bin/python '.YOUTUBEDL.'youtube-dl.py -o '.VIDEOPATH.$fileName.'.flv '.$url.' 2&gt;&amp;1', 'rb'); while(!feof($handle)) { $progress = fread($handle, 8192); $pattern = '/(?&lt;percent&gt;[0-9]{1,3}\.[0-9]{1,2})% of (?&lt;filesize&gt;.+) at/'; ///######Does not execute this if - no matches if(preg_match_all($pattern, $progress, $matches)){ fwrite($fh, $matches[0][0]."\r\n"); } } </code></pre> <p>The output of the from the shell is something like this and the regex should match filesize and percentage.</p> <pre><code>[download] 56.8% of 4.40M at 142.40k/s ETA 00:13 </code></pre> <p>The regex worked on the previous server but not this one. Why? How can I debug this?</p> <p>The difference in the servers is that the previous one was Fedora and its now Centos. Also I specified the shell as /bin/bash.</p> <p>Is there anything in the PHP.ini that could cause a change in this?</p> <p>Please help.</p> <h2>Update</h2> <p>The output of $progress is this: (just a small sample)</p> <pre><code>[download] 87.1% of 4.40M at 107.90k/s ETA 00:05 [download] 89.0% of 4.40M at 107.88k/s ETA 00:04 [download] 91.4% of 4.40M at 106.09k/s ETA 00:03 [download] 92.9% of 4.40M at 105.55k/s ETA 00:03 </code></pre> <h2>Update 2</h2> <p>Could that regex fail because of extra spacing in the output?</p> <p>Also would a different shell make a difference??</p> <h2>[SOLVED]</h2> <p>This was solved and it was due to the regex requiring a P - see here for more details: <a href="https://stackoverflow.com/questions/669178/does-this-regex-in-php-actually-work">Does this regex in PHP actually work?</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload