Use -d option to override the memory limit or other PHP parameters on the command line without modifying php.ini:
php -d memory_limit=1024M script.php