PHP ignored completed in .php module

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Php doesn't seem to work after installation

Postby nic.el » 04. October 2017 08:58

I have the same problem, so
After finishing XAMPP installation, where no eerors or warnings were prompted, and tried to fix ports, 80 to 8082 and 443 to 44343. I was not have any contact with the Server, coming back to ports 80 and 443, I was able to run localhost/xampp and localhost/phpmyadmin. Then made a NEW folder (testfolder) into htdocs directory and tried to connect to a table in mariaDB by name mytesttable. with a script like this:
<title>
<html>
<head>
</body>
HTML SECTION
<?php
db_name = 'test";
db_usr = 'root';
db_pass = 'root's password';
echo ("this is php section');
.......Connection commands......
echo ('end of php section');
/?php>
END OF HTML
</body>
</html>

the PHP section is completely ignored in my case no matter how many times I tried.
Pls advise me.
nic.el
 
Posts: 5
Joined: 04. October 2017 08:39
XAMPP version: 3.3.2
Operating System: Windows 10 64 bit

Re: Php doesn't seem to work after installation

Postby Altrea » 04. October 2017 10:56

Hi,

Your problem is probably different so i have splitted it from the original thread.
Read more about the "one thread per unique user and issue" rule here:
=> [INFO] How to not fail getting help here

How do you try to run your file in your browser?
What address does your browsers address bar show?
Read more about Apache not parsing PHP code here
=> [Q&A] Apache won't parse php code

Please read the following post to get to know why http://localhost/ does not work anymore if you change the default Apache ports
=> [Q&A] Changing the Apache default ports


best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

PHP ignored completed in .php module

Postby nic.el » 05. October 2017 06:03

I have the same problem, so
After finishing XAMPP installation, where no eerors or warnings were prompted, and tried to fix ports, 80 to 8082 and 443 to 44343. I was not have any contact with the Server, coming back to ports 80 and 443, I was able to run localhost/xampp and localhost/phpmyadmin. Then made a NEW folder (testfolder) into htdocs directory and tried to connect to a table in mariaDB by name mytesttable. with a script like this:

Code: Select all

<title>
<html>
<head>
</body>
HTML SECTION
<?php
echo ('php section');
$db_host = 'localhost";
db_name = 'test";
db_usr = 'root';
db_pass = 'root's password';
$conn = mysql_connect (db_host, dbuser,  dbpass);
if (!conn) { die ('Unable to connect: ' . mysql_error()); }
echo ('Connected');
mysql_close($conn);
echo ('end php'');
?php>
END HTML
</body>
,/html>



The script was written on notepad++ and saved in xampp\htdocs\test by the name test_conn.php. The url given in both Firefox and Internet Explorer is:
localhost/test/test_conn.php.
The HTML messages are presenting, but the PHP are not!

Prehistory: When I installed XAMPP on a stand alone machine, I changed the suggested ports: 80 -> 8082 and 443 -> 44343 as suggested, but Apache was not running. So I reinstalled, fearing for remained errors, with the initial values of the ports. Watching the control pannel I didn' t found any error or warning.

Canot think any solution
nic.el
 
Posts: 5
Joined: 04. October 2017 08:39
XAMPP version: 3.3.2
Operating System: Windows 10 64 bit

Re: PHP ignored completed in .php module

Postby Nobbie » 05. October 2017 09:13

Code: Select all
?php>


That is a syntax error, you are using the wrong closing tag. It must be simply "?>" instead. Instead of the control panel, watch the error_log. I am pretty sure that there is somekind of error message "unexpected end of file" or similar.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: Php doesn't seem to work after installation

Postby nic.el » 05. October 2017 09:45

After your suggestion to post on another distinct message my question, which I have already done, if you look at my posts, you realize that the script on the browser is
localhost/testfoler/testconn.php, where php lies on xampp/htdocs/test_folder. There is no any error or warning, just the html Lines are appearing. thank you for your time nic
nic.el
 
Posts: 5
Joined: 04. October 2017 08:39
XAMPP version: 3.3.2
Operating System: Windows 10 64 bit

Re: PHP ignored completed in .php module

Postby nic.el » 05. October 2017 10:11

Examining the script i found that the PHP part is as you stated thus ?> the above script was misstype on behalf of me. As I noticed before there no message on xampp' s control pannel starting stoping apache and/or mysql
Thank you and forgive any incovinience that I produced with my eeroneus typing - nic
nic.el
 
Posts: 5
Joined: 04. October 2017 08:39
XAMPP version: 3.3.2
Operating System: Windows 10 64 bit

Re: PHP ignored completed in .php module

Postby Nobbie » 05. October 2017 12:09

If the error remains, please COPY & PASTE the script into this forum, DO NOT TYPE IT IN. We urgently have to see ORIGINAL code. Also look into the error_log for any hint.
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: PHP ignored completed in .php module

Postby Altrea » 05. October 2017 13:44

echo ('php section');
$db_host = 'localhost";
db_name = 'test";
db_usr = 'root';
db_pass = 'root's password';
$conn = mysql_connect (db_host, dbuser, dbpass);
if (!conn) { die ('Unable to connect: ' . mysql_error()); }
echo ('Connected');
mysql_close($conn);
echo ('end php'');
?php>
END HTML
</body>
,/html>

This code is full of errors, are you kidding?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: PHP ignored completed in .php module

Postby nic.el » 09. October 2017 06:16

As I alredy mentioned the statement
?>
is the last line of the php section, it was a misstyping, since the server is not connected to the Internet, and I had to retype it to post my problem!
As far it concerns additional errors you can find out that are identical to the Maria' s DB tutorials (e.g. www.tutorialspoint.com), in all gogled search
on behalf of mine
nic.el
 
Posts: 5
Joined: 04. October 2017 08:39
XAMPP version: 3.3.2
Operating System: Windows 10 64 bit

Re: PHP ignored completed in .php module

Postby Altrea » 09. October 2017 06:29

nic.el wrote:since the server is not connected to the Internet, and I had to retype it to post my problem!

If the server is not connected to the internet you also needed to retype the code from the tutorials on the server.
So how can we say that you did not mistyping on your server too?
We do not know your current code, we do not know your current log.
Providing remote help with that amount of information is impossible.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 87 guests