Welcome Guest, Not a member yet? Register   Sign In
trying to run phpinfo()
#1
Tongue 
(This post was last modified: 09-17-2021, 06:48 AM by richb201.)

I have a need to check on the status of Xdebug on my server. I uploaded a copy of a file called phpinfo.php to the document root. I then changed permissions to 755 on it. Here is what is in it.
<?php

$a = 1;

$a++;

phpinfo();

I then opened a CLI on the server and changed to the doc root directory. I typed $ phpinfo but I get 
Command 'phpinfo' not found, did you mean:

  command 'pepinfo' from deb emboss
  command 'shpinfo' from deb shapelib

Try: sudo apt install <deb name>


What am I doing wrong?
proof that an old dog can learn new tricks
Reply
#2

If you really want to know PHP CLI's status,

$ php -v

or

$ php phpinfo.php
Reply
#3

(This post was last modified: 09-18-2021, 03:02 AM by richb201.)

ubuntu@ip-172-31-66-147:~$ php -v

Command 'php' not found, but can be installed with:

sudo apt install php7.2-cli
sudo apt install hhvm

I installed those two. 

Now when I run php -v I get
ubuntu@ip-172-31-66-147:~/rst/RST/app$ php -v
PHP 7.2.24-0ubuntu0.18.04.9 (cli) (built: Aug 16 2021 05:46:32) ( NTS )
Copyright © 1997-2018 The PHP Group

Now I am able to run phpinfo. THX!
proof that an old dog can learn new tricks
Reply
#4

Note that CLI PHP is different from PHP used by the web server.
Reply
#5

Turns out that I needed to run phpinfo() from the cli inside the container, not outside. Just unfortunate I had to pay a consultant to find that.
proof that an old dog can learn new tricks
Reply
#6

(This post was last modified: 09-22-2021, 12:49 PM by richb201.)

I am trying to run phpinfo.php from the CLI on my server. I was told that running the phpinfo on my browser will be different from running it on the webserver from within the container's CLI. Anyone know anything about this?
proof that an old dog can learn new tricks
Reply




Theme © iAndrew 2016 - Forum software by © MyBB