www.webdeveloper.com
Results 1 to 7 of 7

Thread: It's Like My Computer Doesn't Recognize PHP Anymore

  1. #1
    Join Date
    Apr 2011
    Posts
    4

    It's Like My Computer Doesn't Recognize PHP Anymore

    This is really driving me nuts...

    I use XAMPP and Wordpress quite often to develop web pages locally.

    Everything has been working fine for months, then all of a sudden one day I refresh my browser to see a CSS modifications and blam...I start getting PHP errors. And not just one or two, but every single line of PHP code will come up with an error. If I delete one line of code, it'll just move on to the very next line of PHP and kick back an error.

    I've looked everywhere for an answer, and quite frankly I think I'm done with my old developer forum because it's hardly visited anymore. So I'm here, and I was hoping someone could help me out a little because I'm out of ideas.

    Here is the index.php code. The first error occurs on Line 9 (where the PHP starts). Nothing fancy, just a simple Wordpress head template I use; and sorry in advance, no clue how to make this look any prettier on a forum.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    
    <head profile="http://gmpg.org/xfn/11">
    
    <title>Avatarati</title>
    
    <meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />	
    
    <meta name="generator" content="WordPress <?php bloginfo('version'); ?>" /> <!-- leave this for stats please -->
    
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
    
    <link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="<?php bloginfo('rss2_url'); ?>" />
    
    <link rel="alternate" type="text/xml" title="RSS .92" href="<?php bloginfo('rss_url'); ?>" />
    
    <link rel="alternate" type="application/atom+xml" title="Atom 0.3" href="<?php bloginfo('atom_url'); ?>" />
    
    <link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
    
    <?php wp_get_archives('type=monthly&format=link'); ?>
    
    <?php //comments_popup_script(); // off by default ?>
    
    <?php wp_head(); ?>


    Here is the error code that pops up when I visit the localhost:

    <meta http-equiv="Content-Type" content="
    Fatal error: Call to undefined function bloginfo() in C:\xampp\htdocs\wordpress\wp-content\themes\avatarati\index.php on line 9


    I've completely reinstalled XAMPP and Wordpress and I've also tried the localhost in different browsers - nothing works. The only thing that works is taking out every single line of PHP code from my index file.

  2. #2
    Join Date
    Apr 2011
    Posts
    4
    Hmm, didn't even say a "hi" or "please" in my post and I can't find an edit post feature lol. Sorry about that.

    Hi I'm Avatarati and I'm new to the forums. Anyone have an idea what this issue could be? I'd greatly appreciate any feedback

    I'm just frustrated, sorry lol.

  3. #3
    Join Date
    Jul 2010
    Location
    /ramdisk/
    Posts
    865
    Does this still run on your production site?

    Are you keeping backups (SVN/GIT/CVS)?
    I use (, ; : -) as I please- instead of learning the English language specification: I decided to learn Scheme and Java;

  4. #4
    Join Date
    Apr 2011
    Posts
    4

    .

    Production site isn't up, hasn't been in a while. I could test it, but I'm very curious as to why PHP stopped working altogether on my localhost. Index files from other projects won't even work.

    Maybe I should post this in a XAMPP forum too hehe.

  5. #5
    Join Date
    Apr 2011
    Posts
    4

    Fixed

    I have no clue what I did, but I went through the installations of every single thing I could think of and it now works. I'm guessing it had nothing to do with the PHP itself but rather I simply didn't activate my custom theme in the localhosted wordpress admin.

    I'm dumb haha.

    Sorry for the worthless thread lol.

  6. #6
    Join Date
    Jul 2010
    Location
    /ramdisk/
    Posts
    865
    Lets go down the checklist:

    [W]) Your machine boots up. Windows is more or less working
    [A]) Apache is serving the pages
    [M]) <---- can't tell if MySQL is working or not!
    [P]) PHP is serving errors- it's still running

    Possibly the issue is with your MySQL. I'm not entirely sure about the inner workings of WordPress, but if you can't connect to MySQL I can see how almost everything else would `break`. PHP forgives almost ANY error (its criminal I know) and continues to execute the script- so even if your development XAMP server couldn't connect the the database- it would continue serving up errors.

    You should edit your index.php file and at the VERY top put:

    <?php error_reporting(E_ALL); ?>

    Then post back with the list of errors that PHP generates.
    I use (, ; : -) as I please- instead of learning the English language specification: I decided to learn Scheme and Java;

  7. #7
    Join Date
    Jan 2006
    Location
    MN
    Posts
    440
    Doesn't the function bloginfo() have to be defined before you try to execute it? I don't see the function anywhere. Is there a include() missing?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles