-
hakre
php ubuntu php-5.3 php-cli
I have written some code that I run remotely on a server via the php-cli and a particular method within this code (I’m unsure which method at the moment) is causing a segmentation fault.Apart from adding exit and echo calls down through my methods and manually pinpointing the bad bits – is there a way to catch the segmentation fault as it happens and find out what piece of the puzzle is crashing? Standard PHP errors are displayed through the error shutdown handlers, I’m unsure where to start wi
-
hakre
-
root
php timezone php-cli
I use below codes to convert a 12hour UTC to a new timezone MySourceCodes: (part of my udp socket server codes) // $gps_time = “9:43:52″; $gps_time = $time_hour.”:”.$time_min.”:”.$time_sec; // $time_received = “01:45:04 2012-07-28”; $time_received = date(‘H:i:s Y-m-d’);$utc = new DateTimeZone(“UTC”); $moscow = new DateTimeZone(“Europe/Moscow”); //Instantiate both AM and PM versions of your time $gps_time_am = new DateTime(“$gps_time AM”, $utc); $gps_time_pm = new DateTime(“$gps_time
-
Matthias
mysql php php.ini php-cli
I try to run a PHP script from the command line, but get the following error:Call to undefined function mysql_connect()However, the mysql module is loaded:root /var/www/scripts # php -m | grep mysql mysql mysqli pdo_mysqlI am on a Debian machine, so all modules are being loaded in their own .ini file:root /var/www/scripts # php –ini Configuration File (php.ini) Path: /etc/php5/cli Loaded Configuration File: /etc/php5/cli/php.ini Scan for additional .ini files in: /etc/php5/cli/conf.d Ad
-
meagar
php php-cli
i wanna using curl in php script and run it in command line mode.here is the script<?php//enable_dl(“php_curl.dll”);$ch = curl_init();$options=array(CURLOPT_URL=>”http://test.com/wp-content/themes/bluefocus/images/desc_img.jpg”,CURLOPT_BINARYTRANSFER=>true,CURLOPT_VERBOSE=>true);curl_setopt_array($ch,$options);$data = curl_exec($ch);$fp=fopen(“test.jpg”,”w”);fwrite($fp,$data);curl_close($ch); ?>i run it in cmd with command php get.phpthe error message:D:\project>php get.phpFata
-
Milo LaMar
powershell php-cli
This question is regarding dollar signs “$” $ in Windows PowerShell ISE.I have PHP CLI and want to run one liner command scripts from the prompt in Windows PowerShell ISE.php -r “$foo = ‘foo’;”Just returns Parse error: parse error in Command line code on line 1 and I’ve narrowed it down to the pesky dollar sign which is significant in PowerShell. Can I escape it somehow?I also tried php -r ‘$foo = “foo”;’ and get Notice: Use of undefined constant foo – assumed ‘foo’ in Command line code on lin
-
hakre
php php-cli
I’m running a PHP script from CLI that user the DirectoryIterator::getExtension() method in PHP.The version of PHP I’m running under is 5.3.5, but I keep getting errors saying Fatal error: Call to undefined method DirectoryIterator::getExtension()The script works fine in my local dev machine running PHP 5.3.6, with no errors. However, the page for DirectoryIterator::getExtension() in the PHP man has no mention of version.Can anyone tell me what version I need to use this method?
-
Boaz
php php-cli
Why might the PHP -l switch not find errors in test.html.$ cat test.html <?php error_reporting(E_ALL); echo “Hello, world!”;sdfsdfsdfsdf?> $ php -dhtml_errors=0 -ddisplay_errors=On -l test.html No syntax errors detected in test.html $ php test.html Hello, world!PHP Notice: Use of undefined constant sdfsdfsdfsdf – assumed ‘sdfsdfsdfsdf’ in test.html on line 7 $ Other types of errors are also not found, such as undefined functions, require_once() to nonexistant files, incorrect syntax in
-
hakre
php curl php-cli
Curl would not work on windows Command Prompt but it working fine on the browser (localhost)Error:C:\wamp\www\site>C:\wamp\bin\php\php5.3.0\php.exe -f index.phpPHP Fatal error: Call to undefined function curl_init() in C:\wamp\www\site\index.php on line 111Fatal error: Call to undefined function curl_init() in C:\wamp\www\site\index.php on line 111Yes PHP Curl is enabled, like I said it work fine on the browser.
-
konsolenfreddy
php sqlite3 xml-parsing cli php-cli
Hello I’m getting the following error Notice: Undefined offset: 1 in file.php on line 113line 113 is $publish_content=$matches2[1];This is my codeif(!preg_match(‘/\<content\:encoded\>(?:\<\!\[CDATA\[)?(.*?)(?:\]\]\>)?\<\/content\:encoded\>/si’,$item,$matches2)){for($i2=0;$i2<count($info_tag_pairs);$i2++){if(preg_match(‘/’.custom_preg_quote($info_tag_pairs[$i2][0]).'(.*?)’.custom_preg_quote($info_tag_pairs[$i2][1]).’/si’,$item,$matches2)){break;}}}$publish_content=$match
-
Jeffrey04
osx-leopard macports warning php-cli
Whenever I run my php command line script, before the script actually outputs to the screen, php always returns a bunch of error messages as follows:PHP Warning: PHP Startup: Unable to load dynamic library ‘/opt/local/lib/php/extensions/no-debug-non-zts-20060613/gd.so’ – (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library ‘/opt/local/lib/php/extensions/no-debug-non-zts-20060613/mbstring.so’ – (null) in Unknown on line 0 PHP Warning: PHP Startup: Unable to load
-
Sandeepan Nath
linux php.ini php-extensions php-cli
I have two php.ini files – /etc/php.ini which loads in case of cli /opt/lampp/etc/php.ini which loads in case of browser.I am able to use PHP’s Mailparse extension after adding the line extension=mailparse.so in the /opt/lampp/etc/php.ini and restarting lampp. But I am not able to load the same in case of command line – getting PHP Fatal error: Call to undefined function mailparse_msg_create() in …mailparse_msg_create() is a part of the Mailparse extension.I tried by relogging with the user
-
Jonathon Wisnoski
php apache pdo crash php-cli
I have a really weird problem with a script I just wrote.It works perfectly using the CLI. Using the browser it crashes twice with the only error being:Error 103 (net::ERR_CONNECTION_ABORTED): Unknown error.Problem signature: Problem Event Name: APPCRASH Application Name: httpd.exe Application Version: 2.4.3.0 Application Timestamp: 502f70a3 Fault Module Name: StackHash_e136 Fault Module Version: 6.1.7601.17725 Fault Module Timestamp: 4ec49b8f Exception Code: c0000374 Exception Offset:
-
Sander Versluys
php php-cli
I’ve installed various PHP packages to be able to use PHP with Apache but also in the commandline. From both I need to be able to connect to MySQL databases. Pretty simple right? That’s what I thought but with php-cli I receive following error:Fatal error: Call to undefined function mysql_pconnect()I have tried starting from scratch by removing all depending packages and configuration like this:sudo apt-get –purge remove php5 libapache2-mod-php5 php5-cli php5-mysqlThen I’ve run following comman
-
middaparka
php php-cli
I have a very limited access to server php configuration files . when I run some of my cron scripts which involves writing log files , I am getting a warning like this Comments starting with ‘#’ are deprecated in /etc/php5/cli/conf.d/ming.ini on line 1 in Unknown on line 0I googled a lot to find the reason , I got to know that we need to replace the ‘#’ with ‘;’ in ming.ini file . I informed this to my server admin to fix this below is the link where I got this fixHow to fix: PHP Deprecated er
-
hakre
php warnings php-extension php-cli
After recompiling php I get the following errors when I use php cli:PHP Warning: PHP Startup: imap: Unable to initialize module Module compiled with module API=20050922 PHP compiled with module API=20090626 These options need to matchin Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library ‘/usr/lib/php/modules/ldap.so’ – /usr/lib/php/modules/ldap.so: undefined symbol: third_arg_force_ref in Unknown on line 0 PHP Warning: PHP Startup: Unable to load dynamic library ‘/u