Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: PHP scripts pop-up from browser instead of executing

  1. #1
    Join Date
    Jul 2011
    Location
    Čačak, Serbia
    Posts
    80

    Default PHP scripts pop-up from browser instead of executing

    Hello,
    I installed LAMP using YaST, configured web server using script mysql_secure_installation
    as suggested in https://en.opensuse.org/SDB:LAMP_setup

    Now I have got problem: scripts not execute - they pop up from browser in popup windows that asks if I want to open it or download it (like it does for attachments). What can i do to make my scripts execute in web browser?

    Thank you for answering my questions

  2. #2
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    19,852
    Blog Entries
    14

    Default Re: PHP scripts pop-up from browser instead of executing

    Most likely you haven't enabled the php apache module. That will cause the webserver not knowing how to handle it. Do
    Code:
    sudo a2enmod php
    sudo systemct restart apache2.service
    You may have to change 'php' to 'php7'.
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    https://en.opensuse.org/openSUSE:Board#Members
    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  3. #3
    Join Date
    Jul 2011
    Location
    Čačak, Serbia
    Posts
    80

    Post Re: PHP scripts pop-up from browser instead of executing

    I didn't want to open new thred, buz I have this problem again, but with php7. I tried to things you suggested:

    Code:
    sudo a2enmod php
    sudo systemct restart apache2.service
    but:
    after second step
    Code:
    sudo systemct restart apache2.service
    I got message:

    sudo: systemct: command not found
    I installed LAMP using YaST Pattern (PHP is version 7)

    What can I do to make this fixed?

    Sorry that I post in old thread, and tell me if I have to start new with this question.

    Thank you for answering my questions.

  4. #4
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,156

    Default Re: PHP scripts pop-up from browser instead of executing

    A typo in Knurpht's post.
    Code:
    systemctl restart apache2.service
    But OTOH, you, as system maintainer, should know about things like systemd in general and systemctl in particular.

    And please next time when you want to show us something your saw in a terminal emulator (computer text), do a copy/paste of the whole thing, that is the line with the prompt and the command, all output lines and the line with the new prompt. All between CODE tags. And not as you did: splitting the command and part of the output and posting one part between CODE tags and the other part between QUOTE tags. A lot of work for you and for others difficult to interprete and to trust.
    Last edited by hcvv; 05-Oct-2019 at 03:57.
    Henk van Velden

  5. #5
    Join Date
    Jul 2011
    Location
    Čačak, Serbia
    Posts
    80

    Default Re: PHP scripts pop-up from browser instead of executing

    Quote Originally Posted by hcvv View Post
    A typo in Knurpht's post.
    Code:
    systemctl restart apache2.service
    But OTOH, you, as system maintainer, should know about things like systemd in general and systemctl in particular.

    And please next time when you want to show us something your saw in a terminal emulator (computer text), do a copy/paste of the whole thing, that is the line with the prompt and the command, all output lines and the line with the new prompt. All between CODE tags. And not as you did: splitting the command and part of the output and posting one part between CODE tags and the other part between QUOTE tags. A lot of work for you and for others difficult to interprete and to trust.
    I did what you said: typed
    Code:
    systemctl restart apache2.service
    but it is still the same.

  6. #6
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,156

    Default Re: PHP scripts pop-up from browser instead of executing

    Quote Originally Posted by Vajcek View Post
    I did what you said
    No, you didn't. I asked you to post what you see on the screen complete.

    I will give you an example:
    NOT
    =============================
    I did
    Code:
    uname -s
    but all I got was
    Linux boven 4.12.14-lp151.28.16-default #1 SMP Wed Sep 18 05:32:19 UTC 2019 (3e458e0) x86_64 x86_64 x86_64 GNU/Linux
    =============================
    BUT
    =============================
    Code:
    henk@boven:~> uname -a
    Linux boven 4.12.14-lp151.28.16-default #1 SMP Wed Sep 18 05:32:19 UTC 2019 (3e458e0) x86_64 x86_64 x86_64 GNU/Linux
    henk@boven:~>
    =============================
    I hope you see the difference and how this is done.
    Henk van Velden

  7. #7
    Join Date
    Jul 2011
    Location
    Čačak, Serbia
    Posts
    80

    Default Re: PHP scripts pop-up from browser instead of executing

    I thionk this time I didn't made wrong:

    Code:
    zlatic@linux-ntw3:~> su
    Password: 
    linux-ntw3:/home/zlatic # systemctl restart apache2.service
    linux-ntw3:/home/zlatic #
    And then I got situation: popup window that asks me if I want to open or save php script

  8. #8
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,156

    Default Re: PHP scripts pop-up from browser instead of executing

    Thanks. We now see that that the restarting of Apache went ok.

    But I have one more remark (oh, am I pedantic, am I ).
    You prefer su. That is fine, I do also. But please then always use
    Code:
    su -
    Do not forget about the - sign (which is btw short for -l, read the man page of su). Omitting it is a security risk and can also bring other surprises.

    Back to your problem. We did not see anything about the
    Code:
    a2enmod php
    This was started almost 9 months ago and you did not report then if the advice from Knurpht did help you.
    So please tell if you either forgot about your own problem for 9 months or if there was succes in January and that now you have the same problem again and when that is the case, what did you do that it reappeared? Update or whatever?
    Last edited by hcvv; 05-Oct-2019 at 06:28.
    Henk van Velden

  9. #9
    Join Date
    Jul 2011
    Location
    Čačak, Serbia
    Posts
    80

    Default Re: PHP scripts pop-up from browser instead of executing

    Quote Originally Posted by hcvv View Post
    Thanks. We now see that that the restarting of Apache went ok.

    But I have one more remark (oh, am I pedantic, am I ).
    You prefer su. That is fine, I do also. But please then always use
    Code:
    su -
    Do not forget about the - sign (which is btw short for -l, read the man page of su). Omitting it is a security risk and can also bring other surprises.

    Back to your problem. We did not see anything about the
    Code:
    a2enmod php
    This was started almost 9 months ago and you did not report then if the advice from Knurpht did help you.
    So please tell if you either forgot about your own problem for 9 months or if there was succes in January and that now you have the same problem again and when that is the case, what did you do that it reappeared? Update or whatever?
    Last time I wrote, it wass successfully. Now, please, I would like to start new thread, because I did not write it correctly. I did not forget, I am lost in the wood of problem Thank you for undestand me

  10. #10
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    25,156

    Default Re: PHP scripts pop-up from browser instead of executing

    Yes, I think a new thread is better. And please, first sit down and overthink it before you compose a post. Always understand that others are unknown to your system, your situation and can not see what you do. Never assume that the way you do things are automaticaly undrstood by others that may get the same results in a different way.

    Communication here is not always easy, but everybody does what he can.
    Henk van Velden

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

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