More of: Can't Open PHP Files

Problems with the Windows version of XAMPP, questions, comments, and anything related.

More of: Can't Open PHP Files

Postby Woodworx » 03. July 2011 19:45

I have read several threads about this topic, but no solutions for me so far.

Here is my issue:
I have installed XAMPP on my Windows computer running Windows7. I got the installation done properly, and can run Apache and mySQL through the Control Panel just fine. Status shows it's on and I can get to my Xampp Welcome Page at both "localhost" and at "127.0.0.1". Everything is good there. The problem is: my browser WILL NOT FIND ANYTHING BELOW THE XAMPP ROOT LEVEL. It will not see anything in htdocs or any other folder for that matter.

Everything is placed properly, based on all the docs that I have read. It's as follows: c:/xampp/htdocs/WorxBlog/index.php

I have typed every possible configuration of the address and still no luck.

Here are the error messages I get:


--Fatal error: Call to undefined function get_header() in C:\xampp\htdocs\WorxBlog\index.php on line 1

--Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
127.0.0.1
7/3/2011 2:34:35 PM
Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1

--Also, I can't see the dynamic pages through Dreamweaver, even though I have configured the testing server.

Here is what I have tried:

Rebooting
Refreshing
Reinstalling using Zip format
Various address variations
Allowed access through firewall for Apache and mySQL

So, someone please give me a hand solving this puzzle. Thanks a bunch.
Woodworx
 
Posts: 10
Joined: 03. July 2011 19:12

Re: More of: Can't Open PHP Files

Postby Sharley » 04. July 2011 01:10

Woodworx wrote:I can get to my Xampp Welcome Page at both "localhost" and at "127.0.0.1". Everything is good there.
This means that XAMPP is working as it should in the default state and the files and folders that you see are in C:\xampp\htdocs\xampp folder.

Woodworx wrote: The problem is: my browser WILL NOT FIND ANYTHING BELOW THE XAMPP ROOT LEVEL. It will not see anything in htdocs or any other folder for that matter.
See the above as your browser is seeing files and folders in the htdocs Apache DocumentRoot as defined in the httpd.conf file in the apache folder.

Woodworx wrote:Everything is placed properly, based on all the docs that I have read. It's as follows: c:/xampp/htdocs/WorxBlog/index.php
The correct address to type in your browser for the above file location is:
http://localhost/WorxBlog/
or
http://localhost/WorxBlog/index.php
Remember that everything associated with XAMPP is case sensitive.
TIP
Don't use upper case unless it is absolutely essential or it may start to get confusing and cauld cause unexplained errors.

Woodworx wrote:--Fatal error: Call to undefined function get_header() in C:\xampp\htdocs\WorxBlog\index.php on line 1
Best paste here in between forum Code tags the code in this index.php file so we can take a look at it's syntax and a offer a possible solution for your error.

Woodworx wrote:--Object not found!
This is best investigated by reading the C:\xampp\apache\logs\error.log file where you will find a more detailed account of this 404 error.

I can't answer with a solution for your DreamWeaver issue at this point as it may be an issues with DW and not with XAMPP.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: More of: Can't Open PHP Files

Postby Woodworx » 04. July 2011 03:46

Thanks for responding. What is frustrating is, as I had said, I tried every combination of addressing the site. Just a few examples are:
http://localhost/xampp/htdocs/worxblog/index.php
http://127.0.0.1/xampp/htdocs/worxblog/index.php
http://localhost/worxblog/index.php
http://127.0.0.1/worxblog/index.php
http://127.0.0.1/worxblog
http://localhost/worxblog
etc. etc.

When I use the correct one that you suggest (http://localhost/worxblog) the error I get is: Fatal error: Call to undefined function get_header() in C:\xampp\htdocs\worxblog\index.php on line 1

I tried every combination, but nothing gets past the Xampp Welcome page. It seems like xampp is not correctly reading the folder structure it is suppose to follow. I even went back and changed "WorxBlog" to "worxblog" to see if that would help. I then went to the setup_xampp batch file to reconfigure the setup, and rebooted, but nothing has helped.

Reading the error log, it seems that it is looking deeper into the folder structure (C:/xampp/htdocs/xampp/htdocs). Here is a good chunck of the log (its too big to give the entire page, but it is the same anyway.

[Sun Jul 03 13:17:35 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/xampp/htdocs
[Sun Jul 03 13:17:52 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/xampp/xampp
[Sun Jul 03 13:18:03 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/xampp/htdocs
[Sun Jul 03 13:18:07 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/xampp/htdocs
[Sun Jul 03 13:18:18 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/htdocs
[Sun Jul 03 13:18:30 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/WorxBlog/index.html
[Sun Jul 03 13:29:56 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/xampp/htdocs
[Sun Jul 03 13:31:04 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/php.info
[Sun Jul 03 13:31:15 2011] [error] [client 127.0.0.1] script 'C:/xampp/htdocs/phpinfo.php' not found or unable to stat
[Sun Jul 03 13:32:48 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/xampp/apache
[Sun Jul 03 13:33:20 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/xampp/php
[Sun Jul 03 13:35:12 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/xampp/htdocs
[Sun Jul 03 13:35:18 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/xampp/htdocs
[Sun Jul 03 13:35:30 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/htdocs
[Sun Jul 03 13:51:34 2011] [warn] pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Sun Jul 03 13:51:34 2011] [notice] Digest: generating secret for digest authentication ...
[Sun Jul 03 13:51:34 2011] [notice] Digest: done
[Sun Jul 03 13:51:34 2011] [notice] Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Sun Jul 03 13:51:34 2011] [notice] Server built: Oct 18 2010 01:58:12
[Sun Jul 03 13:51:34 2011] [notice] Parent: Created child process 5228
[Sun Jul 03 13:51:35 2011] [notice] Digest: generating secret for digest authentication ...
[Sun Jul 03 13:51:35 2011] [notice] Digest: done
[Sun Jul 03 13:51:36 2011] [notice] Child 5228: Child process is running
[Sun Jul 03 13:51:36 2011] [notice] Child 5228: Acquired the start mutex.
[Sun Jul 03 13:51:36 2011] [notice] Child 5228: Starting 150 worker threads.
[Sun Jul 03 13:51:36 2011] [notice] Child 5228: Starting thread to listen on port 443.
[Sun Jul 03 13:51:36 2011] [notice] Child 5228: Starting thread to listen on port 80.
[Sun Jul 03 13:52:30 2011] [error] [client 127.0.0.1] script 'C:/xampp/htdocs/xampp/test.php' not found or unable to stat
[Sun Jul 03 13:52:45 2011] [error] [client 127.0.0.1] script 'C:/xampp/htdocs/test.php' not found or unable to stat
[Sun Jul 03 13:56:48 2011] [error] [client 127.0.0.1] PHP Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'root'@'localhost' (using password: NO) in C:\\xampp\\htdocs\\xampp\\cds.php on line 64, referer: http://127.0.0.1/xampp/navi.php
[Sun Jul 03 14:02:00 2011] [error] [client 127.0.0.1] user not found: /xampp/index.php
[Sun Jul 03 14:04:42 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/xampp/htdocs
[Sun Jul 03 14:32:48 2011] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined function get_header() in C:\\xampp\\htdocs\\WorxBlog\\index.php on line 1
[Sun Jul 03 14:34:35 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/xampp/htdocs
[Sun Jul 03 15:02:02 2011] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined function get_header() in C:\\xampp\\htdocs\\worxblog\\index.php on line 1
[Sun Jul 03 15:02:37 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/thdocs
[Sun Jul 03 15:02:50 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/thdocs
[Sun Jul 03 15:03:03 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/htdocs
[Sun Jul 03 15:06:14 2011] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined function get_header() in C:\\xampp\\htdocs\\worxblog\\index.php on line 1
[Sun Jul 03 15:06:16 2011] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined function get_header() in C:\\xampp\\htdocs\\worxblog\\index.php on line 1
[Sun Jul 03 15:06:18 2011] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined function get_header() in C:\\xampp\\htdocs\\worxblog\\index.php on line 1
[Sun Jul 03 16:43:38 2011] [warn] pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Sun Jul 03 16:43:38 2011] [notice] Digest: generating secret for digest authentication ...
[Sun Jul 03 16:43:38 2011] [notice] Digest: done
[Sun Jul 03 16:43:39 2011] [notice] Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Sun Jul 03 16:43:39 2011] [notice] Server built: Oct 18 2010 01:58:12
[Sun Jul 03 16:43:39 2011] [notice] Parent: Created child process 3660
[Sun Jul 03 16:43:40 2011] [notice] Digest: generating secret for digest authentication ...
[Sun Jul 03 16:43:40 2011] [notice] Digest: done
[Sun Jul 03 16:43:41 2011] [notice] Child 3660: Child process is running
[Sun Jul 03 16:43:41 2011] [notice] Child 3660: Acquired the start mutex.
[Sun Jul 03 16:43:41 2011] [notice] Child 3660: Starting 150 worker threads.
[Sun Jul 03 16:43:41 2011] [notice] Child 3660: Starting thread to listen on port 443.
[Sun Jul 03 16:43:41 2011] [notice] Child 3660: Starting thread to listen on port 80.
[Sun Jul 03 16:48:58 2011] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined function get_header() in C:\\xampp\\htdocs\\worxblog\\index.php on line 1
[Sun Jul 03 16:50:56 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/xampp/worxblog
[Sun Jul 03 16:51:05 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/xampp/htdocs
[Sun Jul 03 19:30:43 2011] [warn] pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Sun Jul 03 19:30:43 2011] [notice] Digest: generating secret for digest authentication ...
[Sun Jul 03 19:30:43 2011] [notice] Digest: done
[Sun Jul 03 19:30:43 2011] [notice] Apache/2.2.17 (Win32) mod_ssl/2.2.17 OpenSSL/0.9.8o PHP/5.3.4 mod_perl/2.0.4 Perl/v5.10.1 configured -- resuming normal operations
[Sun Jul 03 19:30:43 2011] [notice] Server built: Oct 18 2010 01:58:12
[Sun Jul 03 19:30:43 2011] [notice] Parent: Created child process 2380
[Sun Jul 03 19:30:44 2011] [notice] Digest: generating secret for digest authentication ...
[Sun Jul 03 19:30:44 2011] [notice] Digest: done
[Sun Jul 03 19:30:45 2011] [notice] Child 2380: Child process is running
[Sun Jul 03 19:30:45 2011] [notice] Child 2380: Acquired the start mutex.
[Sun Jul 03 19:30:45 2011] [notice] Child 2380: Starting 150 worker threads.
[Sun Jul 03 19:30:45 2011] [notice] Child 2380: Starting thread to listen on port 443.
[Sun Jul 03 19:30:45 2011] [notice] Child 2380: Starting thread to listen on port 80.
[Sun Jul 03 22:01:17 2011] [error] [client 127.0.0.1] File does not exist: C:/xampp/htdocs/xampp/worxblog

Why do I have an xampp folder within the htdocs folder in the xampp folder???? The files are different and appear to be the content for the "Welcome Page" for xampp where your controls are at. It seems to be looking in there for my site instead of the next layer up. How do I fix this?

I don't know if this helps you. It's confusing the hell out of me!
Woodworx
 
Posts: 10
Joined: 03. July 2011 19:12

Re: More of: Can't Open PHP Files

Postby Sharley » 04. July 2011 04:48

Woodworx wrote:When I use the correct one that you suggest (http://localhost/worxblog) the error I get is: Fatal error: Call to undefined function get_header() in C:\xampp\htdocs\worxblog\index.php on line 1

Code: Select all
[Sun Jul 03 16:48:58 2011] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined function get_header() in C:\\xampp\\htdocs\\worxblog\\index.php on line 1
So why have you not pasted here the php code from this index.php file that I asked for so it can be looked at for correctness as you have an obvious error that will not permit the index.php to load.
The address I gave you is correct and the only one to use to access the index.php file in question.

There is no point in trying every combination you can think of as they will only fill up your error.log file with errors that they are obviously doing now.
Sharley wrote:Why do I have an xampp folder within the htdocs folder in the xampp folder???? The files are different and appear to be the content for the "Welcome Page" for xampp where your controls are at. It seems to be looking in there for my site instead of the next layer up. How do I fix this?
It doesn't need fixing as it is not broken - the errors, as I pointed out above that refer to the htdocs\xampp folder are the results of your incorrect address requests from your browser.

The solution now is to fix the error in the php code of your index.php file and without seeing it there is no chance of any more help from this forum.

Just so you know that you are typing the correct address that I gave you and that your issue is with the php code in the index.php file try this:
Copy the index.html file that is in the C:\xampp\htdocs folder into your C:\xampp\htdocs\worxblog folder and then go to http://locahost/worxsblog/index.html and you should see It Works! in your browser. (I noticed you now use lowercase worxblog, is that correct?)

If so then you now should be less confused and able to see that the index.php is at fault and need correcting before you can move forward.

BTW http://locahost/xampp/phpinfo.php will give you that file that shows an error in your log file.
Last edited by Sharley on 04. July 2011 05:07, edited 1 time in total.
User avatar
Sharley
AF Moderator
 
Posts: 3316
Joined: 03. October 2008 05:10
Location: Yeppoon, Australia Time Zone: GMT/UTC+10
Operating System: Win 7 Pro 32bit/XP Pro SP3

Re: More of: Can't Open PHP Files

Postby Altrea » 04. July 2011 04:55

Woodworx wrote:Thanks for responding. What is frustrating is, as I had said, I tried every combination of addressing the site.

What's very frustrating for us is, that you don't give us all information you got.

Woodworx wrote:When I use the correct one that you suggest (http://localhost/worxblog) the error I get is: Fatal error: Call to undefined function get_header() in C:\xampp\htdocs\worxblog\index.php on line 1

Thats good, because thats an error from the php parser not from Apache.
But where does the php function get_header() come from?
I found this error message in combination with Wordpress Themes.
So: Is that a Wordpress Theme you want to get parsed?
If so: Have you installed Wordpress?

Woodworx wrote:It seems like xampp is not correctly reading the folder structure it is suppose to follow.

Thats so completely wrong. Apache reads the folder structure correct. But neither Apache nor the PHP parser can know what the function get_header() have to do if it isn't existing.

Woodworx wrote:Why do I have an xampp folder within the htdocs folder in the xampp folder????

You haven't. But if you try to access http://localhost/xampp/htdocs/ Apache thinks you want to access that folder. So it's your fault that you use the wrong URL.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: More of: Can't Open PHP Files

Postby Woodworx » 04. July 2011 14:47

Thank you Sharley and Altrea for your input, but no need to give me attitude. I'm just a rookie at using apache and php and I'm just struggling along. Here is more info for you:

Woodworx wrote:Why do I have an xampp folder within the htdocs folder in the xampp folder????

Altrea commented: You haven't. But if you try to access http://localhost/xampp/htdocs/ Apache thinks you want to access that folder. So it's your fault that you use the wrong URL.

Yes, I can understand how using that string will get me below where I need to be. That makes sense, but I was trying everything, since the logical address wouldn't work. So let's move on. Altrea, you are correct about Wordpress. This is a new Wordpress theme that I am using for my blog (I am converting my old b2evolution version to a nicer Wordpress theme). Having said that, I am trying to work on the files from my computer in Dreamweaver, instead of the torturous method of editing design through the WordPress control panel, which gives you limited control. I have been making some changes this way but it is tedious. To see the actual new theme as it is on my site, go to http://www.thewoodworx.com/blog and you will see it. Bouncing between the control panel and a "View Source" window, I have made some design changes, but could have done it in 1/3 the time in Dreamweaver. BTW my current "live" b2evo blog is at http://www.thewoodworx.com/worxblog, and my website is still pointing to that, not the new WP theme we are working on.

OK Sharley, here is all the code from the index.php file from my site:

<?php get_header(); ?>

<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div <?php post_class() ?> id="post-<?php the_ID(); ?>">




<div class="indent">
<div class="tail">
<div class="comments"><?php comments_popup_link ( '0 comments ', ' 1 comment', '% comments ', '' , 'off'); ?></div><div class="title"><h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2></div>
<div class="txt">Posted by <?php the_author_link() ?></div>
</div>
<div class="text-box">
<?php the_content('Read more'); ?>
</div>
</div>







</div>
<?php endwhile; ?>

<div class="navigation nav-top">
<div class="alignleft"><?php next_posts_link('&lt;&lt; Older entries') ?></div>
<div class="alignright"><?php previous_posts_link('Newer entries &gt;&gt;') ?></div>
</div>

<?php else : ?>
<h2 class="pagetitle">Not Found</h2>
<p class="center">Sorry, but you are looking for something that isn't here.</p>
<?php get_search_form(); ?>
<?php endif; ?>



<?php get_footer(); ?>


Since that file doesn't have much detail, here is the contents of the "header.php" file. I don't know if that helps you or not. By the way, addressing ANY of the php files in this folder gets the same error messages.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/11001/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title><?php wp_title('&laquo;', true, 'right'); ?> <?php bloginfo('name'); ?></title>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="alternate" type="application/atom+xml" title="<?php bloginfo('name'); ?> Atom Feed" href="<?php bloginfo('atom_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />

<?php if ( is_singular() ) wp_enqueue_script( 'comment-reply' ); ?>
<?php //comments_popup_script(600, 600); ?>
<?php wp_head(); ?>

<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="http://info.template-help.com/files/ie6_warning/ie6_script.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/cufon-yui.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/cufon-replace.js"></script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/jcarousellite.js"></script>
<script type="text/javascript">
$(function() {
$(".carousel").jCarouselLite({
btnNext: ".next",
btnPrev: ".prev"
});
});
</script>
<script type="text/javascript" src="<?php bloginfo('stylesheet_directory'); ?>/js/drop-down-menu.js"></script>


</head><body>
<div class="main" onload="new ElementMaxHeight(); ">
<div id="header">
<div class="indent2">
<div id="dropmenu">
<?php
wp_page_menu('show_home=0&sort_column=menu_order, post_title&link_before=&link_after=');
?>
</div>
</div>
<?php get_search_form(); ?>

<div class="container"> <div class="logo"><h1 onclick="location.href='<?php echo get_option('home'); ?>/'"><?php bloginfo('name'); ?></h1></div></div>
<img alt="" src="<?php bloginfo('stylesheet_directory'); ?>/images/arrow3.gif" width="1" height="398" class="arrow3" />
<div class="container1">
<div class="carousel-box">
<div class="inner">
<button class="prev"></button>
<button class="next"></button>
<div class="carousel">
<ul>
<li><a href="#"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/img1.jpg" alt="" width="872" height="398" /></a></li>
<li><a href="#"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/img2.jpg" alt="" width="872" height="398" /></a></li>
<li><a href="#"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/img3.jpg" alt="" width="872" height="398" /></a></li>
<li><a href="#"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/img4.jpg" alt="" width="872" height="398" /></a></li>
<li><a href="#"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/img5.jpg" alt="" width="872" height="398" /></a></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div id="content">
<div class="container">

<?php get_sidebar(); ?>


And yes, when I copy the index.html file into my worxblog folder, I do get "It Works". So something is not allowing it to read php files. I notice that all of the php files are shown with generic "text" icons, not a "php" icon. Is that the case when using xampp, or could something be fubar'd (do you know that reference?) with the xampp installation?

To confirm...when I type: "localhost/worxblog/index.php" I get this error message:
Fatal error: Call to undefined function get_header() in C:\xampp\htdocs\worxblog\index.php on line 1
So we are on the right track. Question is...is it the php code in the files, or the installation of xampp?

I hope I got to all of your questions. Again, thanks for your insight into this problem.
Woodworx
 
Posts: 10
Joined: 03. July 2011 19:12

Re: More of: Can't Open PHP Files

Postby Altrea » 04. July 2011 15:28

Woodworx wrote:And yes, when I copy the index.html file into my worxblog folder, I do get "It Works". So something is not allowing it to read php files.

No, thats not correct. Your Apache CAN read and access .php files. Otherwise it couldn't see that there is a get_header() function in it.

Woodworx wrote:Question is...is it the php code in the files, or the installation of xampp?

it is the php code in the files.
Your XAMPP is working correct if the XAMPP Backend with it's example pages are working correct => http://localhost/xampp/

Woodworx wrote:
Code: Select all
<?php get_header(); ?>

Here is the first problem. Your index.php calls the get_header() function. But it's nowhere defined! There is no include or require in that file that defines the get_header() function. And thats because the get_header() function is a Wordpress function defined in the Wordpress files.

How does Apache should know about that function? How does your Apache get the articles you are referencing in your file? To do all this, Wordpress is needed as environment.

So install your theme in Wordpress locally and then work with Dreamweaver to change the files in there (in the hope you have configured Dreamweaver correct, which doesn't seem to be often the case by beginners).
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: More of: Can't Open PHP Files

Postby BigWetDog » 04. July 2011 15:51

Backing up Altrea here.
Your installation is working fine. PHP is being parsed. The problem is with your application.
And as Altrea suggests, a little google for your error turns up much WordPress related content, specifically replacing index.php
User avatar
BigWetDog
 
Posts: 148
Joined: 25. February 2010 15:54

Re: More of: Can't Open PHP Files

Postby Woodworx » 04. July 2011 16:49

Thanks! That all makes sense. However, I'm just getting into these pages, and trying to learn some php, which I know zip about now. I was relying on the program to put that correct information into the header. The new questions is...what the hell do I do now? And, even though I am working on these pages in Dreamweaver, do I need to have WordPress installed on my computer? I really just wanted to tweak the CSS file for layout, and put it back on the host server.

Altrea wrote:Here is the first problem. Your index.php calls the get_header() function. But it's nowhere defined! There is no include or require in that file that defines the get_header() function. And thats because the get_header() function is a Wordpress function defined in the Wordpress files.


I think the damn light bulb in my head just turned on. Forgive my total stupidity in this matter, but is this correct? Does the theme have to be assembled through WordPress ON MY COMPUTER first to be able to be seen individually through Dreamweaver (and Apache.) If this is true, I feel like a fucking idiot! :oops: And if that is true (not the idiot part) will the data I need in the index.php automatically populate itself???

Thanks for zero-ing in on this problem for me.
Woodworx
 
Posts: 10
Joined: 03. July 2011 19:12

Re: More of: Can't Open PHP Files

Postby Woodworx » 04. July 2011 17:09

Just to clarify...
I do have all of the blog files on my computer, not just a single .css or .php file. They are just not running on WordPress on my computer.
Woodworx
 
Posts: 10
Joined: 03. July 2011 19:12

Re: More of: Can't Open PHP Files

Postby BigWetDog » 04. July 2011 17:16

Um, yes, and I think Altrea answered this earlier too, you need to install wordpress locally (i.e. to your XAMPP installation)
User avatar
BigWetDog
 
Posts: 148
Joined: 25. February 2010 15:54

Re: More of: Can't Open PHP Files

Postby Woodworx » 04. July 2011 17:54

Doooohhhh!

OK, I'm working on it. I am having trouble logging into phpMyAdmin on the xampp page to create a WP database. It won't let me in! Tried all passwords but non worked. Any thoughts?

I have already downloaded WP and placed it in the root of the xampp folder. Just trying to create the DB before I fire it up.

I feel stupid about not thinking I had to have WP on my side too! I'm new to installing servers on my system, and I guess I hadn't thought that one through yet. SORRY! :lol:
Woodworx
 
Posts: 10
Joined: 03. July 2011 19:12

Re: More of: Can't Open PHP Files

Postby Woodworx » 04. July 2011 17:57

Anyway, its time to go eat and drink too much. Happy 4th everyone!

For any of you not in the US, hell, go eat and drink too much anyway!!!!
Woodworx
 
Posts: 10
Joined: 03. July 2011 19:12

Re: More of: Can't Open PHP Files

Postby Woodworx » 04. July 2011 18:41

Hey is all this a waste of time on my part??? I just read in the WordPress docs, that they don't even recommend using Dreamweaver to edit their files! What kind of BS is that?

And what of the blog folder now? Does it stay where it is, in htdocs; or does it get placed into wordpress/wp-content/themes like on the host server? Damn, more questions!
Woodworx
 
Posts: 10
Joined: 03. July 2011 19:12

Re: More of: Can't Open PHP Files

Postby BigWetDog » 04. July 2011 19:06

Woodworx,
Please take this constructively (the spirit in which it is intended) : I'd like to recommend at this point, that you really should try a more appropriate forum. It's clear that your XAMPP installation is up and running. We've done what we can for you here. That's not to say there aren't experience WordPress user/admin types here, but you are more likely to get better support on a subject specific (i.e. WordPress) forum elsewhere.
User avatar
BigWetDog
 
Posts: 148
Joined: 25. February 2010 15:54

Next

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 151 guests