novigator display code instead of executing it - php

I am trying to write a webpage in php.
I installed wamp64, it has the php7.4 version selected, however when I try to display my page on the navigator it shows the code instead of running it.
I also have the following message when I go on localhost :
Notice: Undefined index: urlAddLocalhost in C:\wamp64\www\index.php on line 33
don't know if this is related.
Am I correct to assume that php is downloaded with wamp and apache when I did instaled wamp?
If not how should I proceed ?

Thanks guys, in the end there was a problem with were I placed my wamp files ... problem solved

Related

undefined function sqlsrv_connect() work fine in cmd console, but not in Xampp

I am new in both PHP and SQL Server. My initial problem was cmd console does not recognize sqlsrv_connect() function. After setting up the drivers. editing the php.ini and etc, I had manage to connect to my local sql server via running php script from the cmd console like below:
C:\xampp\htdocs>php GetContacts.php
However, upon setting up my php file in the Xampp root directory and trying to access it via localhost:81/getContacts.php , I got the error below:
Fatal error: Call to undefined function sqlsrv_connect() in C:\xampp\htdocs\GetContacts.php on line 18
What's weird is that why does it work fine in cmd console but not in the browser? I tried several types of different browser but none of them work. I have been googling around for the past 2 days but no luck. Please advise
It turns out that restarting Xampp process solved the problem, silly me

cannot run phpMyAdmin on Windows 10 - session.save_path issue?

I have installed mysql, php5 and apache on windows 10 and I downloaded phpMyAdmin but when I try to open it from localhost/phpmyadmin I get the error message:
Fatal error: Call to undefined function __() in C:\apache24\htdocs\phpmyadmin\libraries\sanitizing.lib.php on line 135
which I don't understand.
In one of other threads I found an information this may be caused by session.save_path being wrongly configured and when I open phpinfo() in the row with this variable there is no value in neither of the columns.
Apache is up and running and php is working and so is mysql. What could be the issue?
Thanks in advance for suggestions.
If you don't get your problem solved, you could try using this program for hosting your website on your localhost. I'm using it all day long and haven't got any problems with that, yet.
https://www.apachefriends.org/de/index.html

Drupal Error: Undefined Offset: 0 error & Fastcgi

Thanks for reading this. I apologize if there is a simple solution to this but I have been through the forums/Google to find a fix and no luck as yet.
I am getting a Notice: Undefined offset: 0 error. The landing page renders but but all links shoot straight to a "Not Found" error page.
Are these two issues related? I read somewhere, that the Notice: Undefined offset: 0 error is from not having fastcgi as the php rendering engine. Is this correct? and will this solve that issue?
The server is Windows based with Plesk.
You can view the issue here
http://southbaypontoons.com.au/
Thanks in advance for the help!
The first issue, where you are getting 404 files errors for all of your links looks like it might be a rewrite issue.
I am not sure what webserver you are using with Plesk for Windows, but most likely it is IIS - the webserver that comes with Windows.
See this page for the rewriterules: http://drupal.org/node/3854
This will work if you have the IIS rewrite plugin for IIS (http://www.iis.net/downloads/microsoft/url-rewrite) If it is not your own server, you may need to ask your webhost to enable it.
As for the missing images - they are there. Look for example at http://southbaypontoons.com.au/sites/default/files/banner/slider-img1.jpg ... this is the image that is on the top of the home page.
It seems like you need to go through all of your drupal content and remove the /drupal/ at the front of all the images.

curl wont work on wamp can open the WordPress installer but when click go come up with this : curl_init() in C:\wamp\www\installer.php on line 364

Its a nightmare, whenever I click go on the installer page I come up with
Fatal error: Call to undefined function curl_init() in C:\wamp\www\installer.php on line 364
I have no idea what to do, have edited both Apache and PHP to remove the curl code, still not working.
Enable the php extension and then restart wampserver
I had the same problem, download the curl fix extensions from here ->
http://www.anindya.com/php-5-4-3-and-php-5-3-13-x64-64-bit-for-windows/
try this link first -> php_curl-5.3.13-VC9-x64.zip
It seems to be a Windows 7 64 bit issue. Don't forget to restart all services after the change.

PHP error don't display on Opensuse 11 Firefox

On opensuse 11, Firefox isn't displaying php errors. For exemple, I have correct.php and broken.php :
correct.php
<?php echo("test"); ?>
broken.php
<?php echo("toto ?>
Loading correct.php, displaying "test"
Loading broken.php, displaying "test" again
In fact, the loaded page seems the same.
I tried on Windows 7 Firefox and it's showing :
PHP Parse error: syntax error...
My PC is on Opensuse, I borrowed the Windows one to test this thing...
And I don't have access to the server (only a ftp on a sub-folder of the website)
Thanks a lot if you help me, if you don't thanks anyway cause stackoverflow's helping me a lot (even without asking 8D )
edit : If I'm going to broken.php with a link (), the URL isn't changing on OpenSuse FF, on Windows FF it's going to the page with the php error
at the php.ini check if the display_error = on
if not change it to on then restart the web server
then try again
Try putting this at the top of your file:
error_reporting(E_ALL);

Categories