My page php don't working! I get the code in screen!

Posted September 8, 2015 11.6k views
PHPPHP Frameworks

A create a php file with that code to test:


and I get that screen:

When I acess my php page, only after insert a login I get the code:

That is the problem!

  • Can you provide a bit more detail.

    • Is your php page in the same directory as the phpinfo test script?
    • Are you using apache2+mod_php or nginx+php5-fpm?
    • Does your script have a .php extension?
    • Does it have proper permissions (owned by www-data)?

    With a bit more information I can assist you in tracking down this issue.

  • Answers…

    1. Is your php page in the same directory as the phpinfo test script?
      Yes, in the same directory!

    2. Are you using apache2+modphp or nginx+php5-fpm?
      I have apache, but I don’t know identify if I have +mod
      php, can you help me step by step? :’(
      I am a beginner in programming Linux.

    3. Does your script have a .php extension?
      Yes, my script have a .php extension and working fine in the previous server (shared hosting.)

    4. Does it have proper permissions (owned by www-data)?
      I have problems with it, because I don’t know setup permissions, including in my wordpress blog I don’t can’t install plugins because a get a message saying: “You can’t create that directory”

  • Hi @Nayara

    It seems you are using ZPanel for running your server. Please be advised that this panel has been vulnerable to security threats due to it’s inherent architecture and updates.

    Coming to your query, it seems that you have not been able to setup your Apache Hosts and your PHP is not getting compiled properly on the server. If it is possible you can try to deploy a test droplet and install simple LAMP (Apache, MySQL & PHP stack on Linux) and test again.

    I think with this simple basic stack your problems will be solved. If it does, then we can discuss to prepare your server into a more robust and secured one!


  • @Nayara I too have been seeking the solution to this problem … It appears not on several servers I have tried to use. I have been through ALL of the google pages/user groups I could find … one “ex” host “fixed it temporarily” but then couldn’t tell me WHAT they did & now it is “broken again … If you Find ANY resolution please post or let me know … Thank you

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

But others php pages working fine, only that php page don’t working in digitalocean, how can happened it?

And if I install “LAMP” can cause any problem? Because I already have all my directories of site in the air.