TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 11-21-2010, 03:37 PM   #1 (permalink)
http://www.narvenblog.com
 
Join Date: Nov 2010
Location: Lisboa, Portugal
Posts: 12
Thanks: 0
narven is on a distinguished road
Wink $_SERVER['SCRIPT_FILENAME'] empty?

Hi,

Can someone tell me if it's possivel that this:

PHP Code:
echo $_SERVER['SCRIPT_FILENAME'
doesn't do nothing? it's empty :(

any reason why?

thanks
__________________
there's something about the web...
http://www.narvenblog.com
narven is offline  
Reply With Quote
Old 11-21-2010, 05:25 PM   #2 (permalink)
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

does this happen in windows with apache or IIS? I've read about this error happening in Windows.
tony is offline  
Reply With Quote
Old 11-21-2010, 06:21 PM   #3 (permalink)
http://www.narvenblog.com
 
Join Date: Nov 2010
Location: Lisboa, Portugal
Posts: 12
Thanks: 0
narven is on a distinguished road
Default

On my localhost (Windows with Apache) it works ok, but in the server running CentOS and Apache... doesn't work.

Could it be the PHP version? The server is runing PHP 5.1.6 and Apache 2.2.3

But the weird thing is that, if i run the phpinfo() and i look the at PHP variables, it gives me the SCRIPT_FILENAME :(
__________________
there's something about the web...
http://www.narvenblog.com
narven is offline  
Reply With Quote
Old 11-21-2010, 06:39 PM   #4 (permalink)
http://www.narvenblog.com
 
Join Date: Nov 2010
Location: Lisboa, Portugal
Posts: 12
Thanks: 0
narven is on a distinguished road
Default

nop sry.. it doesnt give in phpinfo()... i was looking at SCRIPT_NAME
__________________
there's something about the web...
http://www.narvenblog.com
narven is offline  
Reply With Quote
Old 11-21-2010, 07:00 PM   #5 (permalink)
The Addict
 
tony's Avatar
 
Join Date: Aug 2008
Posts: 336
Thanks: 8
tony is on a distinguished road
Default

it shouldn't be the version, that functionality has been there since I can remember.
But the $_SERVER variables do depend on the server, so it might be a server difference of setup.
maybe __FILE__ would work for you.
tony is offline  
Reply With Quote
Old 11-21-2010, 07:16 PM   #6 (permalink)
http://www.narvenblog.com
 
Join Date: Nov 2010
Location: Lisboa, Portugal
Posts: 12
Thanks: 0
narven is on a distinguished road
Default

nop, i've testes that too with __FILE__, not working
__________________
there's something about the web...
http://www.narvenblog.com
narven is offline  
Reply With Quote
Old 11-21-2010, 08:17 PM   #7 (permalink)
Wizard
Top Contributor 
 
Village Idiot's Avatar
 
Join Date: Sep 2007
Posts: 1,299
Thanks: 17
Village Idiot is on a distinguished road
Default

I know this sounds odd but if you are on a shared server they might cause that. Shared host sometimes restrict weird things. I cant think of a reason why none of those variables would be working.
__________________

Village Idiot is offline  
Reply With Quote
Old 11-22-2010, 03:59 PM   #8 (permalink)
http://www.narvenblog.com
 
Join Date: Nov 2010
Location: Lisboa, Portugal
Posts: 12
Thanks: 0
narven is on a distinguished road
Default

i'm not in a shared server.

i'm talking to the server admin's to try to fix that :) thanks
__________________
there's something about the web...
http://www.narvenblog.com
narven is offline  
Reply With Quote
Old 11-22-2010, 06:28 PM   #9 (permalink)
The Contributor
 
SaintIsaiah's Avatar
 
Join Date: Jan 2009
Posts: 48
Thanks: 5
SaintIsaiah is on a distinguished road
Default

Attached is the stock PHP 5.1.6 php.ini file. Backup your old one and replace it with the stock one, being sure to fill in any server specific information in the ini you need to get PHP running (extension dir, etc.)

I've had this issue before and it turned out to be a corrupted module dll (curl) that was causing my $_SERVER variables (PHP_SELF, SCRIPT_FILENAME, REMOTE_ADDR) to not function properly. It was only when I started with a stock php.ini file and enabled 1 module at a time that I found the issue.

Also, when you quoted your php code in your first post, did you properly terminate the line with a semicolon (";") in your code?

Hope this helps.
Attached Files
File Type: zip php.ini.zip (15.6 KB, 10 views)
SaintIsaiah is offline  
Reply With Quote
Old 11-25-2010, 04:15 PM   #10 (permalink)
http://www.narvenblog.com
 
Join Date: Nov 2010
Location: Lisboa, Portugal
Posts: 12
Thanks: 0
narven is on a distinguished road
Default

thanks for that, but i cannot test that, because the problem is in the production server, i dont have control in those things.

but im talking to the administration servers to see what is possible to do

thanks.
__________________
there's something about the web...
http://www.narvenblog.com
narven is offline  
Reply With Quote
Old 11-25-2010, 04:16 PM   #11 (permalink)
http://www.narvenblog.com
 
Join Date: Nov 2010
Location: Lisboa, Portugal
Posts: 12
Thanks: 0
narven is on a distinguished road
Default

Quote:
Also, when you quoted your php code in your first post, did you properly terminate the line with a semicolon (";") in your code?
yes there is a semi colon
__________________
there's something about the web...
http://www.narvenblog.com
narven is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Checking empty field then connect 9three Absolute Beginners 1 02-06-2009 10:15 PM
Empty a DB? obolus MySQL & Databases 8 03-02-2008 11:32 PM


All times are GMT. The time now is 04:35 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design