Jump to content

Recommended Posts

Hey, I know there was a thread about this but it was marked solved so I didn't know if I should post in there.

 

So yea, I used the little script in that thread, written below:

 

<?php
   echo "testing
?>

 

It obviously has an error in it, but when i uploaded it to my website (http://www.mattiaslundin.com/phpscripts/errortest.php) it doesn't generate an error like it should, it's completely blank. I did go into php.ini and here's what the error things say:

 

; display_errors

;  Default Value: E_ALL

;  Development Value: E_ALL

;  Production Value: E_ALL

 

; display_startup_errors

;  Default Value: Off

;  Development Value: On

;  Production Value: Off

 

; error_reporting

;  Default Value: E_ALL

;  Development Value: E_ALL

;  Production Value: E_ALL

 

; html_errors

;  Default Value: On

;  Development Value: On

;  Production value: Off

 

; log_errors

;  Default Value: Off

;  Development Value: On

;  Production Value: On

 

I also went into phpinfo() and display_errors is on and error_reporting has the value 22519 whatever that means.

 

Started with PHP very recently and it's already frustrating the hell outta me :P

 

Grateful for any help!

Any line that starts with a semicolon is a comment, and is not parsed when php loads the .ini file.

 

You should have the following in there for development use:

error_reporting = -1
display_errors = On

If I were you, I'd copy paste this somewhere close to the part you posted above. I added the comment block so you'd be able to spot it easier in the future. You will need to stop and restart Apache for the changes to take effect.

 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;  DEVELOPMENT ERROR REPORTING LEVELS ;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
error_reporting = -1
display_errors = On
;;;;;;;;;;;;;;;;;;;;;;;; END ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Create a file with the following code in it, save it as info.php and upload it. Then load the script in your browser and see what the values of display_errors and error_reporting are listed as.

 

<?php
phpinfo();
?>

I have to admit I don't actually t know the answer to the first question, all I know is I bought the domain from one.com and installed XAMPP. I restarted Apache by going into the XAMPP Control Panel, clicked the Stop button, and then the Start button

Then we need to establish exactly what problem you're trying to solve here. Are you trying to get error reporting working on your hosted web site, or locally on your pc? The question you initially asked implied you want to get error reporting working on your hosted web site.

What I posted above will work for you locally. Add it to the php.ini file on your pc, and restart Apache. As far as on your hosted site, you need to look through the hosting company's FAQ's to determine how to enable it site-wide, but frankly display_errors shouldn't be used on a live site. Error logging should be used instead. That info should also be in the host's FAQ's.

Yea that makes sense, screw the hosted site then :P

 

But it's still not working locally, I tried with a simple testing script, I first made sure it was faulty; got a blank page on both my website as well as locally. Then I made sure it would work; it did work on my website but not locally (by dragging the .php file into the browser). I made sure to add the stuff in php.ini and apache is running. I'm sorry for being a pain in the ass :I

 

the script is

 

<?php

print "testing";
   
?>

You can't drag the php file into your browser. It has to parsed by the web server by calling it in via http://localhost/your_directory/your_filename.php.

How do i do that the easiest way? Is there function for that in for example notepad++ to parse it through localhost? or can i put it in a specific folder?

 

the adress now looks like this:http://localhost/C:/Users/Mattias/Desktop/Stuff/Projects/Webdesign/mattiaslundin.com/phpscripts/errortest.php

 

I'm assuming I did something wrong because it says:

 

Access forbidden!

 

You don't have permission to access the requested object. It is either read-protected or not readable by the server.

 

If you think this is a server error, please contact the webmaster.

Error 403

localhost

2011-01-23 14:02:26

Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1

 

Sorry for being an idiot :)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.