SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    Non-Member
    Join Date
    Jun 2007
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Installing PHP & Apache

    Hi Folks,

    How do I manually install PHP 5 and the apache web server?

  2. #2
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Download the respective installer or ready to use packages of PHP, MySQL and Apache for your Operating System (windows or Linux) and install them accordinly. Apache and MySQL generally have the installer files for windows but i am not sure about the Linux. PHP you can download a zipped package that contains everything you need. Just unzip the package and read the manual to install it.

    But you can use wampserver or xampp for easier which do all for you.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  3. #3
    Non-Member
    Join Date
    Jun 2007
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Installing PHP & Apache

    Rajug,

    I tried using Xampp, but can't seem to create PDF files with it. Using PHP's PDF creator.

    Do you have any ideas to why it doesn't work?

    You can view the php.ini file at the following address: http://www.freewebs.com/mail2go/php.ini

    I am using Xampp downloaded from: http://sourceforge.net/project/downl..._mirror=puzzle

  4. #4
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your php.ini seems to be fine and enabled pdf extension library too. I have xampp version 2.1 and the following code works for me:
    Code php:
    $p = pdf_new();
    /*  open new pdf file; insert a file name to create the pdf on disk */
    if (pdf_begin_document($p, "", "") == 0) {
        die("Error: " . pdf_get_errmsg($p));
    }
     
    pdf_set_info($p, "Creator", "hello.php");
    pdf_set_info($p, "Author", "Rainer Schaaf");
    pdf_set_info($p, "Title", "Hello world (PHP)!");
     
    pdf_begin_page_ext($p, 595, 842, "");
     
    $font = pdf_load_font($p, "Helvetica-Bold", "winansi", "");
     
    pdf_setfont($p, $font, 24.0);
    pdf_set_text_pos($p, 50, 700);
    pdf_show($p, "Hello world!");
    pdf_continue_text($p, "(says PHP)");
    pdf_end_page_ext($p, "");
     
    pdf_end_document($p, "");
     
    $buf = pdf_get_buffer($p);
    $len = strlen($buf);
     
    header("Content-type: application/pdf");
    header("Content-Length: $len");
    header("Content-Disposition: inline; filename=hello.pdf");
    print $buf;
     
    pdf_delete($p);

    Which code is the very first example code in http://www.php.net/pdf code
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  5. #5
    Non-Member
    Join Date
    Jun 2007
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Installing PHP & Apache

    Did you install Xampp or are you using the portable version?

  6. #6
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I installed it with an installer. and i have PHP 5.1.1
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5

  7. #7
    Non-Member
    Join Date
    Jun 2007
    Posts
    254
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Installing PHP & Apache

    I get the following error message:

    Fatal error: Call to undefined function pdf_begin_document() in C:\Documents and Settings\Dale Piper\Desktop\Old Xampp\Xampp\htdocs\PDF.php on line 4

  8. #8
    rajug.replace('Raju Gautam'); bronze trophy Raju Gautam's Avatar
    Join Date
    Oct 2006
    Location
    Kathmandu, Nepal
    Posts
    4,013
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That maybe because of the version of your pdf library. So whenever you get the error in some line just comment that line and proceed running code with remaning, it must give something for you because your pdf library is installed since it did not say undefined function for pdf_new() function.
    Mistakes are proof that you are trying.....
    ------------------------------------------------------------------------
    PSD to HTML - SlicingArt.com | Personal Blog | ZCE - PHP 5


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
  •