Question

This is my first time I use Filezilla and ftp. I uploaded my files.php. After I entered the hostname on address bar, I could see which files I had uploaded. The interesting part comes here: When I clicked on index.php to view, It displayed only the html parts.

When I opened page source code, I saw that my php was commented, like this:

From what I had originally written: <?php include '/includes/php/menu.php'; ?>

it became: <!--?php include '/includes/php/menu.php'; ?-->

If anyone could help me I would appreciate it. Does any of the above has anything to do with host properties? From what I read, it supported php.

Was it helpful?

Solution 3

I wanna thank all for your support. I am rather newbie in PHP and with you advice I have learnt a lot in the process. I have low rep so I can't give good rates to your answers. The problem consisted in ftp, but later after changing some options in the host everything went OK. I guess working with PHP offline differs from online.

Thanks a lot everyone

OTHER TIPS

Your host may support php, but that does not mean that PHP is enabled. You can perform a very simple test to find out.

Create a file named test.php and drop one line of php in it and save it:

<?php phpinfo(); ?>

Upload the test.php file to the server and point your browser to it. It should output a bunch of information about the web server if PHP is working.

If not, check your host admin (cpanel) to see if you can enable it yourself. If you don't find it, just submit a ticket to have your host enable it.

PS: Remember to delete the test.php from your site as it is not great for security to leave it there.

UPDATE:

It sounds like you don't have Includes module installed. If you are using Apache, make sure the Apache Module mod_include. To check if you have the module installed you should create a file called phpinfo.php and upload to your server root and it should include the following code:

<?php
phpinfo();
?>

Then load phpinfo.php in your browser and mod_include should be included in the section Loaded Modules. It would be highly unusual if it wasn't there, as it is the default to have it installed on most Apache systems. If you are not on an Apache server, you can still follow the above instructions.


You can set the default editor to view/edit files under Settings->File Settings->Filetype Associations. An example using Notepad is below. There is also a box to inherit system filetype associations and I have it checked.

txt C:\Windows\System32\notepad.exe
php C:\Windows\System32\notepad.exe

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top