php no longer executes
Posted by: dszum (---.buffalo.res.rr.com)
Date: May 08, 2018 05:35PM

I installed Wampserver 3.1.3 and had no issues. All was working fine.

While using the "build your own database drive website, 4th edition" I entered the code from the book which included: htmlspecialchars($name, ENT_QUOTES, "UTF-8)

Suddenly php would no longer execute, and now just shows in the browser as plain text.

All services show running. I have even uninstalled and completely reinstalled the wampserver. Still, php no longer runs.

What may have changed and how do I fix this? Everything worked fine until I ran that php script.

Installed and functioning:
PhpMyAdmin 4.7.9
Adminer 4.6.2
Apache 2.4.33
PHP 5.6.35
MySQL 5.7.21
Maria 10.2.14
Wampserver 3.1.3 (showing green)

Options: ReplyQuote
Re: php no longer executes
Posted by: RiggsFolly (Moderator)
Date: May 08, 2018 09:46PM

Hi

What is "build your own database drive website, 4th edition"

We cannot be experts on every crackpot suite that exists. That is what has done damage to your WAMPServer.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.3 32bit & 64bit)
<Apache 2.4.29/2.2.31> <PHP 7.2/7.1/7.0/5.6/5.5/5.4> <MySQL 5.7.19/5.6.39/5.5.28>
<MariaDB 10.2.14> <phpMyAdmin4.8.1> <MySQL Workbench 6.3.10>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: php no longer executes
Posted by: dszum (---.buffalo.res.rr.com)
Date: May 08, 2018 09:53PM

It is a book about learning how to write php code. It is not a suite or any other product as you are incorrectly inferring. If you read the original post again- it clearly states in the following sentence that it is a book.

My assumption is that I have accidentally turned off making the php executable. The book was originally written for php 4, so I'd assume something has changed with one of the commands in php 5 which may be causing my error.

Options: ReplyQuote
Re: php no longer executes
Posted by: Otomatic (Moderator)
Date: May 09, 2018 11:22AM

Hi,

> My assumption is that I have accidentally turned off making the php executable.
Do you have access to the Wampserver home page, i.e. localhost?

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.3 32 bit - Apache 2.4.33 - PHP 7.2.7/7.1.19/7.0.30/5.6.36 - MySQL 5.7.22 - MariaDB 10.3.8
Wampserver 3.1.3 64 bit - Apache 2.4.33 - PHP 7.2.7/7.1.19/7.0.30/5.6.36 - MySQL 5.7.22 - MariaDB 10.3.8
PhPMyAdmin 4.8.2 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: php no longer executes
Posted by: dszum (---.buffalo.res.rr.com)
Date: May 09, 2018 03:05PM

Yes, my wampserver page does load under the localhost page. I do not see php listed in the loaded extensions area. Everything else looks like it is running.

Is there an ini file I need to look for where I can reactivate php or add it to the loaded extensions list? Or should i be doing something else?

Thanks!

Options: ReplyQuote
Re: php no longer executes
Posted by: Otomatic (Moderator)
Date: May 09, 2018 03:32PM

Hi,

> Yes, my wampserver page does load under the localhost page.
It should not be YOUR page that is displayed by 'http://localhost/' but the Wampserver home page.
If your page is displayed, it means that you have modified or replaced the wamp/www/index.php file.
The wamp/www/ folder is strictly reserved for Wampserver. It must not be modified and files must not be added to it.
You must put your files in another folder, for example wamp/www/mysite/ and, with VirtualHost, your local site can be anywhere.

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.3 32 bit - Apache 2.4.33 - PHP 7.2.7/7.1.19/7.0.30/5.6.36 - MySQL 5.7.22 - MariaDB 10.3.8
Wampserver 3.1.3 64 bit - Apache 2.4.33 - PHP 7.2.7/7.1.19/7.0.30/5.6.36 - MySQL 5.7.22 - MariaDB 10.3.8
PhPMyAdmin 4.8.2 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: php no longer executes
Posted by: dszum (---.buffalo.res.rr.com)
Date: May 09, 2018 03:43PM

Sorry, I was misunderstood. That is what is occurring. The Wampserver Page does load. It shows the server configuration.

Under loaded extensions however- there is no reference to php. I would assume that php **should** be showing under loaded extensions? How would I add that, if that is the case?

Options: ReplyQuote
Re: php no longer executes
Posted by: RiggsFolly (Moderator)
Date: May 09, 2018 03:58PM

No PHP does not show as a loaded extension.

If you look at the extensions it is telling you about in that section, they are extension that PHP has loaded.

If you see the WAMPServer homepage i.e. the page you describe, then PHP is working as that page is built using PHP

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.3 32bit & 64bit)
<Apache 2.4.29/2.2.31> <PHP 7.2/7.1/7.0/5.6/5.5/5.4> <MySQL 5.7.19/5.6.39/5.5.28>
<MariaDB 10.2.14> <phpMyAdmin4.8.1> <MySQL Workbench 6.3.10>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: php no longer executes
Posted by: Otomatic (Moderator)
Date: May 09, 2018 04:03PM

Hi,

> The Wampserver Page does load. It shows the server configuration.
This means that the PHP code is well interpreted, the Wampserver home page is 90% PHP code.

> Under loaded extensions however- there is no reference to php.
If you can see the loaded extensions, it means that PHP is functional, since PHP itself checks which extensions are loaded by the code : get_loaded_extensions

For your PHP files to be interpreted, you must put them in a folder, for example :
wamp/www/myfolder/myfile.php
Then, to check their execution, in your browser, you type :
'http://localhost/myfolder/myfile.php'

------------------------------------------------------------------------------------------------------------
Wampserver 3.1.3 32 bit - Apache 2.4.33 - PHP 7.2.7/7.1.19/7.0.30/5.6.36 - MySQL 5.7.22 - MariaDB 10.3.8
Wampserver 3.1.3 64 bit - Apache 2.4.33 - PHP 7.2.7/7.1.19/7.0.30/5.6.36 - MySQL 5.7.22 - MariaDB 10.3.8
PhPMyAdmin 4.8.2 - MysqlDumper 1.24.5
on W10 and W7 Pro 64 bit
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: php no longer executes
Posted by: RiggsFolly (Moderator)
Date: May 09, 2018 04:05PM

Are you sure that the script you are trying to run has a .php extension.

If a file containing PHP has any other extension it is not passed by Apache to the PHP interpreter.

So for example if you are trying to run `xxx.html` any PHP in there will show like part of your web page

Also is you are trying to launch your php script using filemanager and clicking on the xxx.php file, it also will not interpret the PHP as doing this does not send the script to apache to launch and of course if Apache does not see the script it cannot spot the `<?php` tag and pass code to PHP for interpretation.


If you are doing this you will see something like `file://path/to/file.php` so if you see the `file://` you are doing it wrong


ALWAYS launch websites from the address bar of your browser. So like `[localhost]'

Of better still read The need for Virtual Hosts and create yourself an Apache Virtual Host for each end EVERY one of your projects

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.1.3 32bit & 64bit)
<Apache 2.4.29/2.2.31> <PHP 7.2/7.1/7.0/5.6/5.5/5.4> <MySQL 5.7.19/5.6.39/5.5.28>
<MariaDB 10.2.14> <phpMyAdmin4.8.1> <MySQL Workbench 6.3.10>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your MySQL databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 1 time(s). Last edit at 05/09/2018 04:06PM by RiggsFolly.

Options: ReplyQuote
Re: php no longer executes
Posted by: dszum (---.buffalo.res.rr.com)
Date: May 09, 2018 04:14PM

I have moved everything to a separate folder within the www folder. After restarting the services it all appears working again.

Thank you for all of your help!

Options: ReplyQuote


Sorry, only registered users may post in this forum.