Script working fine through browser, but through commandline - php

I wrote a script that is accessible through a public URL and it is working fine.
When I execute the script over commandline, I'm only getting php errors. Don't understand why it is not running from command line. What differences do I need to get in mind when running a script from command line or through a browser?
Command:
[user#domain ~]$ /usr/local/bin/php /home/user/domains/url/public_html/soap/mail.php
Errors:
PHP Warning: PHP Startup: Unable to load dynamic library './php_soap.dll' - ./php_soap.dll: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: include(/dbconnect-soap.inc.php): failed to open stream: No such file or directory in /home/user/domains/url/public_html/soap/export.php on line 7
Warning: include(): Failed opening '/dbconnect-soap.inc.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/user/domains/url/public_html/soap/export.php on line 7
Fatal error: Call to a member function query() on a non-object in /home/user/domains/url/public_html/soap/export.php on line 10

Related

I can't open a zip file in php

Code:
echo file_get_contents('zip://arquivos.zip#zipado.txt');
Output error:
PHP Warning: file_get_contents(): Unable to find the wrapper "zip" - did you forget to enable it when you configured PHP? in php shell code online 1
Warning: file_get_contents(): Unable to find the "zip" wrapper - did you forget to enable it when you configured PHP? in php shell code on line 1 PHP Warning: file_get_contents(zip://arquivos.zip#zipado.txt): Failed to open stream: No such file or directory in php shell code on line 1
Warning: file_get_contents(zip://arquivos.zip#zipado.txt): Failed to open stream: No such file or directory in php shell code on line 1
Every time I try to display a file in PHP it returns this error and I can't run my code because the only output is an error, please help me!

error while running mongodb php program

PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20121212+lfs/mongo.so' - /usr/lib/php5/20121212+lfs/mongo.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Fatal error: Class 'MongoClient' not found in /var/www/exhange/b1_functions.php on line 8
This is the error popped up when running a monogdb php program in ubuntu. How can I fix that?

Running PHPUnit on command line errors out

I run this on the command line: phpunit --version
I get the following errors:
PHP Warning: require_once(File/Iterator/Autoload.php): failed to open stream: No such file or directory in /usr/lib/php/pear/PHPUnit/Autoload.php on line 45
PHP Fatal error: require_once(): Failed opening required 'File/Iterator/Autoload.php' (include_path='.:/Users/dennismonsewicz/pear/share/pear:/usr/local/share/pear:/usr/lib/php/pear/PHPUnit') in /usr/lib/php/pear/PHPUnit/Autoload.php on line 45
Anyone else run into these issues? It is also causing me issues when I try to run my tests via the command line.
Ended being an issue with my include_path
This is my updated include path
include_path = ".:/php/includes:/usr/lib/php/pear"

Error in loading CodeIgniter site

My site was developed using CodeIgniter and was working fine before but now it's showing an error.
When I checked error log it's showing:
[07-Jul-2012 09:17:11] PHP Warning: PHP Startup: Suhosin Extension does not officially
support PHP 5.2 and below anymore, because it is discontinued. Use it at your own risk. in
Unknown on line 0
[07-Jul-2012 09:17:11] PHP Warning:
require(/home/maya3d/public_html/system/codeigniter/Common.php) [href='function.require'>function.require]: failed to open stream: No such file or directory in /home/maya3d/public_html/system/codeigniter/CodeIgniter.php on line 38 [07-Jul-2012 09:17:11] PHP Fatal error: require() [href='function.require'>function.require]: Failed opening required '/home/maya3d/public_html/system/codeigniter/Common.php' > (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/maya3d/public_html/system/codeigniter/CodeIgniter.php on line 38
Can anyone please help me to fix it?
Log into the server and run:
ls -l /home/maya3d/public_html/system/codeigniter/Common.php
If it says the file doesn't exist then there's your problem. It could be permissions related as well.

Trying to run a test, but get a fatal error

I configured the external tool correctly. As soon as I start to run a test case I get this error:
Failed loading C:\PHP\5.2.13\ext\php_xdebug.dll
PHP Warning: PHP Startup: Unable to load dynamic library 'C:/PHP/5.2.13/ext\php_oci8.dll' - The specified module could not be found. in Unknown on line 0
PHP Warning: require_once(../../../application/cl/Dict.inc): failed to open stream: No such file or directory in C:\xxx\abc\abbb\application\cl\DictTest.php on line 5
PHP Fatal error: require_once(): Failed opening required '../../../application/cl/Dict.inc' (include_path='.;C:\PHP\5.2.13\pear\') in C:\xxx\abc\abbb\application\cl\DictTest.php on line 5
What could it be?
I can assure this is due to installation path problems.
Did you install phpUnit through pear or separately? if you have installed by PEAR, did you set up the PEAR path in php.ini file?

Categories