+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: PHP execution?

  1. #1
    myildi37 is offline x10Hosting Member myildi37 is an unknown quantity at this point
    Join Date
    Nov 2010
    Posts
    14

    PHP execution?

    Hello,

    I am a new x10 free user. I am migrating an existing web site on this host but I have a problem with my php scripts.
    Even if I try open a very simple test.php file in Firefox, I get an error (see below):

    test.php contains:
    <?php
    Print "<HTML><head>";
    Print "<TITLE>Telechargement</TITLE></head> <body bgcolor='#CC3333' text='#FFFFFF'>";
    Print "<hr><br><H2>Test PHP</H2><br><hr> <p>";
    Print "</head></HTML>";
    ?>

    and I get
    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.
    Please contact the server administrator, no-reply@x10hosting.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
    More information about this error may be available in the server error log.
    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.


    How can I get PhP on the server?


    Thank you very much in advance for your help.


    Murat

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: PHP execution?

    Make sure the file permissions are set to 0644. Something like 0666 or 0777 will cause that error.

    Also, print is not capitalized in PHP.
    Nothing is always absolutely so.

  3. #3
    myildi37 is offline x10Hosting Member myildi37 is an unknown quantity at this point
    Join Date
    Nov 2010
    Posts
    14

    Question Re: PHP execution?

    Thank you very much for your quick reaction! I am completely at lost with this problem.
    My file has 644 as rights, no problem and I have changed prints in the file (I have always thought that both was working in PHP, by the way I have code using Print and working on the server from which I am migrating.
    So, there must be another problem here.

    Does a new user automatically get the rights to use PhP on this host? I have not seen any option about PhP on the management console.

    I do not know anymore where to search...

    Very cordially,

    Murat
    Last edited by myildi37; 11-20-2010 at 05:56 PM.

  4. #4
    lemon-tree's Avatar
    lemon-tree is offline x10 Minion lemon-tree has a spectacular aura about
    Join Date
    Nov 2007
    Posts
    1,420

    Re: PHP execution?

    Do a new user automatically gets rights to use PhP on this host? I have not seen any option about PhP on the management console.
    There should be nothing you need to do for PHP to work, so either the whole server is having an issue or something is up wit your account. Have you got any .htaccess files? If so, try renaming them all briefly and see if the issue persists.

  5. #5
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: PHP execution?

    Also, try creating the scripts in the File Manager. Uploading them sometimes leaves invisible characters that the PHP interpreter chokes on.
    Nothing is always absolutely so.

  6. #6
    bdistler's Avatar
    bdistler is offline x10 Lieutenant bdistler is an unknown quantity at this point
    Join Date
    May 2010
    Location
    Catalina AZ USA
    Posts
    349

    Re: PHP execution?

    What server are you on ????

    Which folder are you putting the script in ????

    I use a LOT of PHP scripts both the old way and PDO on x10Hosting

    Here is my simple test PHP script

    PHP Code:
    <?php
    print "Hello World";
    ?>
    I just uploaded via FileZilla, Murat's script to server boru in folder /public_html
    runs with red background like it should
    Last edited by bdistler; 11-20-2010 at 04:32 PM. Reason: Add test run of Murat's script

  7. #7
    myildi37 is offline x10Hosting Member myildi37 is an unknown quantity at this point
    Join Date
    Nov 2010
    Posts
    14

    Re: PHP execution?

    Thank you very much for your suggestions!

    https://x10hosting.com/control/?hosting
    tells me that I am on chopin.

    The path to my script is public_html/livretj/ (with 777 authorizations, put by default by CyberDuck, or the host. Can this be a source of problem?).

    My script can be tested at the following address:
    http://yildizoglu.x10.mx/livretj/test.php

    I do not have any .htaccess file in this folder.

    I do not seem to have any strange element in my configuration, do I?

    Mainly, I have created my account. Then an ftp account and copied all my working website on x10host's public_html folder under my account. HTML pages work, I have small problems with my DHTML menu system created by Sothink's DHTML Menu (some icons missing even if they are in the corresponding folder), and this global problem with my PhP scripts (nothing very fancy, some simple MySQL based forms). All my system was living and functioning on my preceding server without any problem (a Debian server).

    In the beginning, I have thought that I was misconfiguring access to my MySQL database, but checking that even this simple script is not working, I suspect a PhP problem somewhere.

    The problem is that I am lost at this stage have no idea where this can be.

    Murat

  8. #8
    lemon-tree's Avatar
    lemon-tree is offline x10 Minion lemon-tree has a spectacular aura about
    Join Date
    Nov 2007
    Posts
    1,420

    Re: PHP execution?

    (with 777 authorizations, put by default by CyberDuck, or the host. Can this be a source of problem?).
    There's your problem, change the file permissions to 0644 and the containing folder to 0755 or lower as required. Any file permissions 0777 will be blocked by the server and is what is causing your 500 errors.

  9. #9
    myildi37 is offline x10Hosting Member myildi37 is an unknown quantity at this point
    Join Date
    Nov 2010
    Posts
    14

    Re: PHP execution?

    I have used the file manager in cPanel to change the permissions (for an unknown reason, I cannot do it using Cyberduck - my FTP client)).

    The folders need at least 775 to be accessible by the web server as far as I ca see. If I give them 664, I cannot access to any file, including the HTML files that were accessible before. If I change to 775, the latter become accessible.

    Now, my folders have 775 and my files 664.

    My PhP test file gives a 500 error, even if I put it's authorization to 664. I cannot run any php file on my account, which is normal since even this stupid test.php does not work.

    So there must be a problem at another level :-(

    Any other idea? Am I the only new meeting this problem (on chopin)?

    Do you know if the support people follow these forums? I have sent a support request but have not received any reply.

    Murat

  10. #10
    myildi37 is offline x10Hosting Member myildi37 is an unknown quantity at this point
    Join Date
    Nov 2010
    Posts
    14

    Thumbs up Re: PHP execution? [Solved]

    I have solved the problem using two sources of information (see below).

    To summarize: your folders must have rights 755 and your php files 644 (not 664).

    The support has indicated me the 755 part and installing Moodle using Fantastico, I have seen that it gave 644 rights to the php scripts. Given these rights to my folders and php file have solved the problem.

    It seems that I will now be able to explore this magnificent host!

    Thanks to all!

    Murat

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. max execution time
    By mohTareq in forum Free Hosting
    Replies: 2
    Last Post: 09-16-2010, 03:10 PM
  2. Failed php script execution in cgi-bin
    By xtrain in forum Free Hosting
    Replies: 2
    Last Post: 03-30-2010, 05:05 PM
  3. Server Execution
    By madhouse in forum Free Hosting
    Replies: 5
    Last Post: 09-15-2008, 03:45 PM
  4. PHP Execution Forbidden
    By whpoon in forum Free Hosting
    Replies: 1
    Last Post: 10-03-2007, 10:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers