SitePoint Sponsor

User Tag List

Page 5 of 5 FirstFirst 12345
Results 101 to 119 of 119
  1. #101
    SitePoint Zealot
    Join Date
    Aug 2009
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,

    I've been unsuccessful at creating the first php script example (date according the server) in the post-installation section of Kevin's book (4th edition). I've installed everything manually.

    Apache's status bar is showing PHP 5.2.10. So it seems connected...

    My hunch is that it has something to do with the LoadModule code (?). I put this at the very end of the httpd file after all the tags, is this correct?

    I've made sure to load the page through the local host URL.

    Any help would be great - thanks!

  2. #102
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    swto,

    You said you were unsuccessful; what is happening when you load the page in your browser?
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  3. #103
    SitePoint Zealot
    Join Date
    Aug 2009
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When I load the page in the browser, I get:

    "The date (according to this web server) is "

    There is no date given.

    Thanks, Kevin

  4. #104
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    And if you view source, the PHP code is visible?
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  5. #105
    SitePoint Zealot
    Join Date
    Aug 2009
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes, it is visible - I've triple checked my code

  6. #106
    SitePoint Zealot
    Join Date
    Aug 2009
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually, went ahead and upgraded to php5.3 and went through the installation process again.

    When I changed my httpd file in the conf file and restarted Apache, I got this message: "unable to load dynamic library C:\php5\php_mysqli.dll - specified module could not be found"

    Thanks, Kevin

  7. #107
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    If the code is visible, it means that your web server is not processing the PHP code before sending the page to your browser. Since your Apache server shows that the PHP module is loaded, the most likely problem is a typo in the AddType line that you added to your httpd.conf file (see p.19 of the book). This line is the one responsible for telling Apache to process files ending in .php as PHP scripts.

    As for the new problem you’re having installing PHP 5.3, is the file present at the path mentioned in the error message? I would normally expect the file to be found at C:\php5\ext\php_mysqli.dll, not C:\php5\php_mysqli.dll. Make sure you have properly set the extension_dir option shown on p.17 to make PHP look for its extension files in the right location.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  8. #108
    SitePoint Zealot
    Join Date
    Aug 2009
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok - will double check this -

    also I'm noticing that the 'httpd' file in my conf file is only titled 'httpd' not 'httpd.conf' (I've unchecked the hide filename extensions).

    Does this mean anything or...?

  9. #109
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    How odd. I’m pretty sure the file should be called httpd.conf. If it is named incorrectly, I imagine Apache would be unable to find the file, and would revert to its default settings.

    If you edit the file and type some random characters at the end of it (something like "blarg!") and save that change, does Apache complain about a configuration file error when you restart it? If it doesn’t, that would be a clear sign that Apache is not using that configuration file.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  10. #110
    SitePoint Zealot
    Join Date
    Aug 2009
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I typed in "blarg!" at the end of the file and the restart for Apache "failed".

    So, it must be using this (?).

    Also, I re-installed php 5.2.10 and this solved my other problem about not being able to load the dynamic library.

    However, I still cannot get the php script to work - i.e. to display the date.

    ?? Any more thoughts - thanks so much!

  11. #111
    SitePoint Zealot
    Join Date
    Aug 2009
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    just as a clarification:
    in my httpd file, I am typing:

    LoadModule php5_module "C:/PHP/php5apache2_2.dll"
    AddType application/x-httpd-php .php
    PHPIniDir "C:/PHP"

    and am adding this to the very, very end of the file after all tags, etc.

    Thanks, again

  12. #112
    SitePoint Zealot
    Join Date
    Aug 2009
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    also, the index.php is showing up in the my htdocs folder in Apache

  13. #113
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hmm all looks fine. Could you try downloading the code archive for the book and using the today.php example file included in there? This will eliminate the possibility of a typo in your PHP code.
    Kevin Yank
    CTO, sitepoint.com
    I wrote: Simply JavaScript | BYO PHP/MySQL | Tech Times | Editize
    Baby’s got back—a hard back, that is: The Ultimate CSS Reference

  14. #114
    SitePoint Zealot
    Join Date
    Aug 2009
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well, I feel like an idiot. The code from the archive did the trick and it works now. Sorry to waste so much of your time for such a simple error.

    However, I did learn a lot about the installation process through it all.

    Thanks for helping and this is really a great book - if only this reader would have been more careful in entering code!

    At least I got to type "blarg!"

    Cheers

  15. #115
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I made the same mistake plenty of times. I now reconcile the code I type myself (for practice and retention) with the files provided by the book.

    I have an error in the middle of Chapter 4 and I'm not sure how to fix it. I hope I'm not wasting your time with a simple error. I receive the following error when I try to connect my page with my jokes database:


    Fatal error: Call to undefined function mysqli_connect() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\connect\index.php on line 2

    I cannot determine if the jokes database is being detected yet because I believe this error preceeds database detection. Also, when I try to connect, I use my personal password (replacing "password" in the script), but I am leaving all the default fields as is.

  16. #116
    SitePoint Addict
    Join Date
    Jul 2006
    Location
    Fionnphort, Isle of Mull, Scotland
    Posts
    334
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Great book (4th Edn), but I'm glad I haven't come to it as a PHP beginner !
    I've got an XAMPP server installation, which works fine, but thought I'd try a hand-made one on another computer. I've done the downloading, now for installation.

    The Apache web site says I MUST verify the download, but there's no mention of this in the book. Do I REALLY need to do this ? It looks a little complicated and I might have to download yet more stuff to do it. I'm sure I can cope if necessary, but I don't want to do something if I don't need to.
    Tim Dawson
    Isle of Mull, Scotland

  17. #117
    SitePoint Member
    Join Date
    Jul 2009
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Still wrangling with the same issue... just my job is consuming my life so I don't have enough time to look at it.

    I turned my view error messages on. The problem looks like this:

    Fatal error: Call to undefined function mysqli_connect() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\connect\index.php on line 2

    and my index.php file looks like this:

    <?php
    $link = mysqli_connect('localhost', 'root', 'mintecko0');
    if (!$link)
    {
    $output = 'Unable to connect to the database server.';
    include 'output.html.php';
    exit();
    }

    if (!mysqli_set_charset($link, 'utf8'))
    {
    $output = 'Unable to set database connection encoding.';
    include 'output.html.php';
    exit();
    }

    if (!mysqli_select_db($link, 'ijdb'))
    {
    $output = 'Unable to locate the joke database.';
    include 'output.html.php';
    exit();
    }

    $output = 'Database connection established.';
    include 'output.html.php';
    ?>


    Can someone help me please?

    Thank you!

  18. #118
    Certified Ethical Hacker silver trophybronze trophy dklynn's Avatar
    Join Date
    Feb 2002
    Location
    Auckland
    Posts
    14,604
    Mentioned
    19 Post(s)
    Tagged
    2 Thread(s)
    Alex,

    The mysqli_connect() problem is a simple one: PHP does NOT enable the new mysqli() drivers by default. Merely UNcomment the mysqli line in php.ini and restart Apache. Please note that the mysqli() functions differ from the older mysql() functions in that many require the database handle to be identified (and at the start rather than the end of the argument list).

    Regards,

    DK
    David K. Lynn - Data Koncepts is a long-time WebHostingBuzz (US/UK)
    Client and (unpaid) WHB Ambassador
    mod_rewrite Tutorial Article (setup, config, test & write
    mod_rewrite regex w/sample code) and Code Generator

  19. #119
    SitePoint Member qtronik's Avatar
    Join Date
    Apr 2010
    Location
    Québec, Canada
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fully Usefull but a little paragraph to link to other how to do it thru others webbuilder tool like: Dreaweaver would be more great for already engaged non-php designer's.


Bookmarks

Posting Permissions

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