Web Hosting Forum | Lunarpages

Author Topic: How to find out what your server's PHP has compiled.  (Read 8334 times)

Offline Trey

  • Jedi
  • *****
  • Posts: 933
    • http://www.singfreemusic.com
How to find out what your server's PHP has compiled.
« on: January 16, 2004, 06:58:21 AM »
this will be one of the shortest How-To's in the history of how-to's.

it's a simple way to find out what modules and whatnot are enabled on your server's PHP.

to do this, we'll create a phpinfo() file.  (remember, this will be the shortest how-to you'll likely ever see)

Step 1:

Open notepad, or your favorite text editor.

Step 2:

Place this code into your new file:

Code: [Select]

<html>
 <head>
  <title>PHP Test</title>
 </head>
 <body>
 <?php echo "phpinfo&#40;&#41;";
phpinfo&#40;&#41;; ?>

 </body>
</html>


(note, there are other ways to do this, this just happens to be one of them.  also note that the first "phpinfo()" will just show the word "phpinfo()" in the left of your page when opened in a browser.  this is a good example of using the echo function to create webpages.)

Step 3:

Save your file with any name but end it with .php.

(example:  phpinfo.php)

Step 4:

Upload your page to your account's public_html directory.

Step 5:

Open the page in a browser (http://yourdomain.com/phpinfo.php)

And there you have it, you can check to see if exec() is enabled (a popular one), and nearly anything else about the PHP on your server.

I hope this helps everybody out.  :D

-Trey
This space for rent.  Reasonable rates!

Danielle

  • Guest
How to find out what your server's PHP has compiled.
« Reply #1 on: January 16, 2004, 08:43:29 AM »
Nah, this isn't the shortest how-to, I actually beat you for once on something.  :wink:  I did a how-to in the Beginner's forum on how to link to an avatar at http://www.lunarforums.com/forum/viewtopic.php?t=10087&start=0&postdays=0&postorder=asc&highlight and it is much shorter.

On the other hand, this how-to is much more useful (as well as actually in the how-to section).  :thumb:

Offline Trey

  • Jedi
  • *****
  • Posts: 933
    • http://www.singfreemusic.com
How to find out what your server's PHP has compiled.
« Reply #2 on: January 16, 2004, 10:07:20 AM »
:)

just something that i realized wasn't here, but should be.

it's very easy to do, but i know a lot of people don't realize they can.  :thumb:
This space for rent.  Reasonable rates!

Offline MishaPappa

  • Jabba the Hutt
  • *****
  • Posts: 587
How to find out what your server's PHP has compiled.
« Reply #3 on: January 16, 2004, 10:12:23 AM »
Great How-To information Trey... but there's one other thing to remember:

For security purposes, don't just leave a script named "phpinfo.php" sitting in your domain root where anyone can access it.  Either name it something meaningful to you but hard to guess for others or place it in a protected directory for only you to see.

The information revealed by a full phpinfo() can be quite helpful for hacking...
"I know that you understood what you think I said but I'm not sure you realize that what you heard is not what I meant..."

Andromeda, April 2003 - Sept 2004
Lyra, since Sept 2004

Misha

Offline Trey

  • Jedi
  • *****
  • Posts: 933
    • http://www.singfreemusic.com
How to find out what your server's PHP has compiled.
« Reply #4 on: January 16, 2004, 10:26:26 AM »
true, and i'd forgotten to mention that.  thanks misha.

(note to others, misha rocks.)
This space for rent.  Reasonable rates!

Offline MishaPappa

  • Jabba the Hutt
  • *****
  • Posts: 587
How to find out what your server's PHP has compiled.
« Reply #5 on: January 16, 2004, 01:46:44 PM »
Thanks for plug Trey!!...

I knew him when he was just neonscreamer... :)

It's all about community, right? :D

Or, as the saying goes "It takes a village, people!"... :thumb:
"I know that you understood what you think I said but I'm not sure you realize that what you heard is not what I meant..."

Andromeda, April 2003 - Sept 2004
Lyra, since Sept 2004

Misha

Offline scanman20

  • Senior Moderator
  • Über Jedi
  • *****
  • Posts: 1552
    • http://www.notonebit.com
How to find out what your server's PHP has compiled.
« Reply #6 on: January 16, 2004, 03:21:21 PM »
Quote from: MishaPappa
Great How-To information Trey... but there's one other thing to remember:

For security purposes, don't just leave a script named "phpinfo.php" sitting in your domain root where anyone can access it.  Either name it something meaningful to you but hard to guess for others or place it in a protected directory for only you to see.

The information revealed by a full phpinfo() can be quite helpful for hacking...


Don't all the LP servers have a phpinfo page on them for the public to see? I'm pretty sure I've seen a bunch of posts in these forums saying that.

Also, this is a much shorter version of a phpinfo test script to use than the fist example.

Code: [Select]
<? phpinfo(); ?> :thumb:
Even a broken clock is right twice a day.
NotOneBit.com
MCSE - MCSA - MCP (<- unused since 2006!)

Offline Trey

  • Jedi
  • *****
  • Posts: 933
    • http://www.singfreemusic.com
How to find out what your server's PHP has compiled.
« Reply #7 on: January 16, 2004, 05:35:12 PM »
i agree, but i wanted to throw in a teaser about "echo"ing things into a document (shhh, don't give away my next how-to)

 :evil:

(plus i figured if you incorporate html and php into a document, it'll make most people who are newer to php more comfortable)  :wink:
This space for rent.  Reasonable rates!

Offline Evan29

  • Space Explorer
  • ***
  • Posts: 6
How to find out what your server's PHP has compiled.
« Reply #8 on: January 21, 2004, 04:32:53 PM »
html & php. hmmmm...... Do tell...  :twisted:  :twisted:
 :wink:

Offline Trey

  • Jedi
  • *****
  • Posts: 933
    • http://www.singfreemusic.com
How to find out what your server's PHP has compiled.
« Reply #9 on: January 24, 2004, 12:49:41 AM »
whatcha wanna know?  :?

<---don't know NUTHIN' and you'll never get it outta me!   :evil:
This space for rent.  Reasonable rates!

 

Share |