#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Location
    UK
    Posts
    6
    Rep Power
    0

    php scripts stopped working


    Hello everyone!

    First of all, as you will see, I have no idea of what nature my problem is. I'm not even sure it's a PHP problem, it could as well be a MySQL or (less likely) a server/operating system related problem. I didn't know where to post this, so hopefully someone will move the thread to the right forum if I'm in the wrong place here.

    Anyway, this is my problem:

    I really can't explain it, but my scripts stopped working all of a sudden. All was working fine, but suddenly the pages won't load. The strange thing is that some of the scripts still work, some (which worked fine before) don't anymore. Also I'm using phpmyadmin and I can still connect to and alter the database with it. So I really don't know what the problem is. I don't get any error messages.

    Also, I have noticed that several instances of php.exe appear in the taskmanager. Dunno if this is connected with the problem.

    I read on a different board that it might be because of an antivirus program, and it's true I'm running one, but it was running when the scripts were working fine too, so it can't be the reason I think?

    Reboot doesn't help, so I consider reinstalling PHP (or is it maybe a MySQL problem after all?) if i don't find out what is going on. Hopefully a reinstall will solve the problem.

    Did anyone have a similar problem?

    Thanks in advance for any ideas.

    t.bag

    PS: I am using PHP 4.3.0/MySQL 3.23.55/Apache 1.3.27/WinXP.

    -------------------------
    [edit]

    Ok, this might be helpful: I used the following script (scroll down to the "Testing MySQL" part) and what it did was the following:

    The page loaded the first time so the entry Amir Khan appeared in the browser window. So a database and a table were successfully created and data entered. Phpmyadmin confirms it. But for some reason the page fails to load when I hit reload ... It looks like it would load, but it takes forever and it never actually loads. No further entries are added to the table (like they should when the page is refreshed). I know this script works, as I have tested it before, but it doesn't anymore
    What do you think?

    Yeah and I've installed PHP 4.0.1 and MySQL 4.0.12 now, but the scripts behave in exactly the same way as before

    [/edit]
    Last edited by t.bag; April 15th, 2003 at 05:23 AM.
  2. #2
  3. Second highest poster :p
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2001
    Posts
    7,321
    Rep Power
    36
    PHP 4.0.1? Any reason for the old version. 4.3.1 is the lastest stable for Win32, or you can get 4.3.2 from the snaps.
    - Andreas Koepke

    Koepke Photography

  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Location
    UK
    Posts
    6
    Rep Power
    0
    Erm, it's 4.3.1 ... sorry, my mistake
  6. #4
  7. Second highest poster :p
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2001
    Posts
    7,321
    Rep Power
    36
    Just wondering, the default install of PHP (using the recommended ini file) doesn't echo errors to the screen, check your apache error log and see if there are any parse errors happening.
    - Andreas Koepke

    Koepke Photography

  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Posts
    45
    Rep Power
    15
    I had the same problem till now!!.. but already found what was happening!...

    Open your php.ini file ant check this section

    PHP Code:
    ; Print out errors (as a part of the output).  For production web sites,
    you're strongly encouraged to turn this feature off, and use error logging
    ; instead (see below).  Keeping display_errors enabled on a production web site
    ; may reveal security information to end users, such as file paths on your Web
    ; server, your database schema or other information.
    display_errors = on 
    i had the display_errors variable in OFF.. so set it to ON as the example and youre done.. now youll be able to see your errors on the page!!...

    Greets!

    EDIT----->>>>
    Forgot to tell.. reboot your Apache server!
    Last edited by Next_Gate; April 15th, 2003 at 09:13 PM.
  10. #6
  11. Second highest poster :p
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2001
    Posts
    7,321
    Rep Power
    36
    Well as the comments about that command say, its good to have it off in a production environment. Thats also why i said to check the logs
    - Andreas Koepke

    Koepke Photography

  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Location
    UK
    Posts
    6
    Rep Power
    0

    Post


    Thanks a lot!

    I think this command is actually a good idea. Since I am testing my scripts locally, it's ok to enable the error display.

    The scripts are working again btw! I have no idea why. I even rebooted the machine and reinstalled PHP and MySQL and the problem still didn't go away. But after a while the scripts started working again. I don't know what I did. It was really weird. I hope it won't happen again, cos I was really frustrated and lost so much time on it.
  14. #8
  15. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Location
    UK
    Posts
    6
    Rep Power
    0
    Oh, I just looked at the php.ini and it already says display_errors on (i didn't change it though). This is the relevant part:

    Code:
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ; Error handling and logging ;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    
    ; error_reporting is a bit-field.  Or each number up to get desired error
    ; reporting level
    ; E_ALL             - All errors and warnings
    ; E_ERROR           - fatal run-time errors
    ; E_WARNING         - run-time warnings (non-fatal errors)
    ; E_PARSE           - compile-time parse errors
    ; E_NOTICE          - run-time notices (these are warnings which often result
    ;                     from a bug in your code, but it's possible that it was
    ;                     intentional (e.g., using an uninitialized variable and
    ;                     relying on the fact it's automatically initialized to an
    ;                     empty string)
    ; E_CORE_ERROR      - fatal errors that occur during PHP's initial startup
    ; E_CORE_WARNING    - warnings (non-fatal errors) that occur during PHP's
    ;                     initial startup
    ; E_COMPILE_ERROR   - fatal compile-time errors
    ; E_COMPILE_WARNING - compile-time warnings (non-fatal errors)
    ; E_USER_ERROR      - user-generated error message
    ; E_USER_WARNING    - user-generated warning message
    ; E_USER_NOTICE     - user-generated notice message
    ;
    ; Examples:
    ;
    ;   - Show all errors, except for notices
    ;
    ;error_reporting = E_ALL & ~E_NOTICE
    ;
    ;   - Show only errors
    ;
    ;error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR
    ;
    ;   - Show all errors except for notices
    ;
    error_reporting  =  E_ALL & ~E_NOTICE 
    
    ; Print out errors (as a part of the output).  For production web sites,
    ; you're strongly encouraged to turn this feature off, and use error logging
    ; instead (see below).  Keeping display_errors enabled on a production web site
    ; may reveal security information to end users, such as file paths on your Web
    ; server, your database schema or other information.
    display_errors = On
    
    ; Even when display_errors is on, errors that occur during PHP's startup
    ; sequence are not displayed.  It's strongly recommended to keep
    ; display_startup_errors off, except for when debugging.
    display_startup_errors = Off
    
    ; Log errors into a log file (server-specific log, stderr, or error_log (below))
    ; As stated above, you're strongly advised to use error logging in place of
    ; error displaying on production web sites.
    log_errors = Off
    Maybe it's a good idea to enable E_Notice too? On a different board someone thought the problem would perhaps be caused by an endless loop ...

IMN logo majestic logo threadwatch logo seochat tools logo