Web Hosting Forum | Lunarpages
News: July 14, 2008 - New Contest! - Submit Your WordPress Theme Designs, Win BIG!
August 5, 2008 - Time to Submit Your Links for the August 08 Site of the Month Award!
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
August 21, 2008, 09:08:11 AM


Login with username, password and session length


Pages: [1]   Go Down
  Print  
Author Topic: How to find out what your server's PHP has compiled.  (Read 2436 times)
Trey
Jedi
*****
Offline Offline

Posts: 983



WWW
« 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:

<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.  Very Happy

-Trey
Logged

This space for rent.  Reasonable rates!
Danielle
Resident Alien
Administrator
Berserker Poster
*****
Offline Offline

Posts: 8900


nihil sunt omnia


WWW
« 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).  Thumbs Up
Logged

Danielle Wallace
- nihil sunt omnia -
Lunarpages Webhosting ~ Lunarpages Forums ~ Lunarpages Affiliates
Administrator Training Manager - System Administrator Team


Ruby Asylum - For those crazy about Ruby
A&E Writing Forum ~ Best Garden ~ Endar & Endar Gallery ~ RatingBar.com

Every living creature on this earth dies alone.
Trey
Jedi
*****
Offline Offline

Posts: 983



WWW
« Reply #2 on: January 16, 2004, 10:07:20 AM »

Smile

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.  Thumbs Up
Logged

This space for rent.  Reasonable rates!
MishaPappa
Jabba the Hutt
*****
Offline Offline

Posts: 588


« 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...
Logged

"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
Trey
Jedi
*****
Offline Offline

Posts: 983



WWW
« 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.)
Logged

This space for rent.  Reasonable rates!
MishaPappa
Jabba the Hutt
*****
Offline Offline

Posts: 588


« Reply #5 on: January 16, 2004, 01:46:44 PM »

Thanks for plug Trey!!...

I knew him when he was just neonscreamer... Smile

It's all about community, right? Very Happy

Or, as the saying goes "It takes a village, people!"... Thumbs Up
Logged

"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
scanman20
Master Jedi
*****
Offline Offline

Posts: 1216



WWW
« 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:
<? phpinfo(); ?>
Thumbs Up
Logged

Even a broken clock is right twice a day.
NotOneBit.com
MCSE - MCSA - MCP
Trey
Jedi
*****
Offline Offline

Posts: 983



WWW
« 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 or Very Mad

(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
Logged

This space for rent.  Reasonable rates!
Evan29
Space Explorer
***
Offline Offline

Posts: 6


« Reply #8 on: January 21, 2004, 04:32:53 PM »

html & php. hmmmm...... Do tell...  :twisted:  :twisted:
 Wink
Logged
Trey
Jedi
*****
Offline Offline

Posts: 983



WWW
« Reply #9 on: January 24, 2004, 12:49:41 AM »

whatcha wanna know?  Confused

<---don't know NUTHIN' and you'll never get it outta me!   Evil or Very Mad
Logged

This space for rent.  Reasonable rates!
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks


Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM