Page 2 of 2 FirstFirst 12
Results 11 to 17 of 17

Thread: Cant run php in Chrome

  1. #11
    Join Date
    Oct 2017
    Location
    /dev/sdx
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Cant run php in Chrome

    Quote Originally Posted by zkab View Post
    The phpinfo.php run just fine ... my script is dependent of files in a sub-directory ... so how do I change it will execute in that directory ... can I make a link in /var/www/html/ ?
    yes, you can create here;
    /var/www/html/newdir

    and put your script.php inside newdir

    and try to run link below in your browser;
    http://localhost/newdir
    corn ubuntuforums community.
    Open Source platform where the real world of human is here. Click here for Solve thread

  2. #12
    Join Date
    Aug 2006
    Location
    Stockholm, Sweden
    Beans
    Hidden!

    Re: Cant run php in Chrome

    OK - I copied my subdir - Downloads - to /var/www/html/ so now I have
    /var/www/html$ ls -l
    total 28
    drwxr-xr-x 9 root root 12288 jul 22 11:38 Downloads

    where all my files and scripts are.
    When I run http://localhost/Downloads/ I get:

    Index of /Downloads
    Name Last modified Size Description
    [PARENTDIR] Parent Directory -
    [ ? ] addnewacct.php 2018-07-22 11:38 6.1K
    ... all files are listed here ...

    When I click at the script in the list then I get:
    This page isn’t working
    localhost is currently unable to handle this request.
    HTTP ERROR 500
    The Truth Is Out There

  3. #13
    Join Date
    Aug 2006
    Location
    Stockholm, Sweden
    Beans
    Hidden!

    Re: Cant run php in Chrome

    I forgot to metion that I have LAMP installed also ...
    The Truth Is Out There

  4. #14
    Join Date
    Oct 2017
    Location
    /dev/sdx
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Cant run php in Chrome

    Quote Originally Posted by zkab View Post
    OK - I copied my subdir - Downloads - to /var/www/html/ so now I have
    /var/www/html$ ls -l
    total 28
    drwxr-xr-x 9 root root 12288 jul 22 11:38 Downloads

    where all my files and scripts are.
    When I run http://localhost/Downloads/ I get:

    Index of /Downloads
    Name Last modified Size Description
    [PARENTDIR] Parent Directory -
    [ ? ] addnewacct.php 2018-07-22 11:38 6.1K
    ... all files are listed here ...

    When I click at the script in the list then I get:
    This page isn’t working
    localhost is currently unable to handle this request.
    HTTP ERROR 500

    try to check your php script maybe you have made a little silly mistakes. try to recheck again line by line. php is a flying code maybe it will not run directly by page maybe it will only run when its called via code. or you can try running via index.
    corn ubuntuforums community.
    Open Source platform where the real world of human is here. Click here for Solve thread

  5. #15
    Join Date
    Aug 2006
    Location
    Stockholm, Sweden
    Beans
    Hidden!

    Re: Cant run php in Chrome

    OK - thanks for your support ... I will check the script
    The Truth Is Out There

  6. #16
    Join Date
    Oct 2017
    Location
    /dev/sdx
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Cant run php in Chrome

    sample of call php
    Code:
    <?php get_filename(); ?>
    PHP Code:
    <?php get_filename(); ?>
    filename should be the one that is being called.
    corn ubuntuforums community.
    Open Source platform where the real world of human is here. Click here for Solve thread

  7. #17
    Join Date
    Aug 2006
    Location
    Stockholm, Sweden
    Beans
    Hidden!

    Re: Cant run php in Chrome

    Ok
    The Truth Is Out There

Page 2 of 2 FirstFirst 12

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
  •