The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Doesn't take in account includes (PHP)

Discussion in 'General Discussion' started by Suguro, Jul 21, 2015.

  1. Suguro

    Suguro Registered

    Joined:
    Jul 21, 2015
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    France
    cPanel Access Level:
    Website Owner
    Hello there ! I am new member of this forum and I would like to get some help please if possible.

    I have an issue with the CPanel host server as I added some PHP files but its doesn't work. Some lines aren't taken in account and are not displayed when I look up at the source code , can somebody please tell me how to fix this ?

    example of code lines that aren't taken in account :

    <?php
    include_once('./uploaderModel.php');
    include_once('./uploaderControl.php');
    include_once('./uploaderView.php');

    $uploaderControl = new UploaderControl();
    $uploaderControl -> controlUploadErrors();
    $uploaderControl -> controlExportData();
    ?>

    Thanks !
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,146
    Likes Received:
    34
    Trophy Points:
    48
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Can you please let me know what error are you getting in error logs file ?
     
  3. Suguro

    Suguro Registered

    Joined:
    Jul 21, 2015
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    France
    cPanel Access Level:
    Website Owner
    Thanks for your response !
    The thing is that there is no error ! Its all a blank page. When I tried to put this folder in another server it worked , or at least when I check the source code the PHP lines that I posted in the post before was there...
    You can check for yourself , the code in the file is :

    Code:
    microsource.fr/csvImporter/
    
    <?php
       header('Content-Type: text/html; charset=utf-8');
    ?>
    <html>
       <head>
         <title>Upload CSV</title>
         <meta charset="UTF-8" />
       </head>
       <body>
    
    <?php
       include_once('./uploaderModel.php');
       include_once('./uploaderControl.php');
       include_once('./uploaderView.php');
      
       $uploaderControl = new UploaderControl();
       $uploaderControl -> controlUploadErrors();
       $uploaderControl -> controlExportData();
    ?>
       </body>
    </html>
    
    
    but the code in the source code when I check is :

    <html><head><title>Upload CSV</title><meta charset="UTF-8" /></head><body>

    it's like PHP is disabled but it's not... maybe there is something else I must enable before it works ?
     
    #3 Suguro, Jul 22, 2015
    Last edited by a moderator: Jul 22, 2015
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    667
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    You will likely receive more input on this question at a website focused on PHP coding (e.g. StackOverflow). Does it make a difference if you remove the "meta charset" line?

    Thank you.
     
  5. keat63

    keat63 Well-Known Member

    Joined:
    Nov 20, 2014
    Messages:
    765
    Likes Received:
    20
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Do you know which version of PHP your Cpanel server is running compared to the server which works.
    Also, do you know which version of PHP these files were written for.

    From my experience, PHP v5 has a number of new features over V4 that can cause errors with older PHP files.
    PHP 5.4 has even more differences to 5.3.


    http://php.net/manual/en/function.include-once.php

    I had all sorts of issues getting an old PHP cart to run under V5.
    It wouldn't run under 5.4, and would only run under 5.3 after a lot of work.
     
    #5 keat63, Jul 29, 2015
    Last edited: Jul 29, 2015
Loading...

Share This Page