You are here: How to execute two commands within 'system' « PHP Programming Language « IT news, forums, messages
How to execute two commands within 'system'

Posted by francescomoi on 02/14/06 18:47

Hi.

On PHP4, I want to execute these two system commands:
# cd /home/foo1/foo2
# /usr/local/php/bin/php /home/foo1/foo2/script.php

If I do it via shell, it works ok.

But If I do:
-------
system("cd /home/foo1/foo2/", $retval);
system("/usr/local/php/bin/php /home/foo1/foo2/script.php", $retval);
--------

I get this error message:
-----
Fatal error: main(): Failed opening required '../config/config.php'
(include_path='.:/usr/local/php/lib/php') in /home/foo1/foo2/script.php
on line 2
-----

This error is caused by the fact that the script is not executed in the
right directory.

Any similar experience?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация