Running PHP file on XAMPP, nothing happens - php

Today I installed xampp v3.2.1 and my Apache and MySQL servers are running as you can see:
I am worried about that red thing I marked down with rectangle.
However I can access to localhost:8080, but when I try to run PHP file (e.g. localhost/hey.php) it just shows blank space.

Your port is conflicting. May be IIS server installed on your computer occupied this port.So, try to disable it.
You can check port using below command in linux.
# netstat -tulpn

Related

How to properly install Xampp on Mac in order to run PHP code

I downloaded the installer version of Xampp version 8.1.6-0 for Mac and went to the manager-osx widget to start the Apache and MySQL servers but neither would start.
I then tried using the command sudo apachectl start and then created an index.php file and put it in htdocs, and then tried to open it using http://localhost/index.php as well as http://localhost:8080/index.php and both times it said the server could not be reached.
I've actually downloaded Xamp in the past and was able to reach the server but wasn't able to get php scripts to run, but now for some reason I can't even get the server to run.
I made sure to download the installer and not the virtual machine version. I'm running Monterey version 12.4.
I tried the solutions here but they didn't seem to work. I checked my activity monitor and nothing is running on port 80.
I also installed MAMP from here and tried to start Apache but it displayed the error:
"Apache couldn't be started. Please check your MAMP installation and
configuration."
Any help would be appreciated as I just want to run PHP.

Ubuntu / SQL Server - PHP script works in terminal, but not web application

I have an Ubuntu VM / Azure SQL DB combo where I have two sets of PHP files.
1) Some scripts that run from CRON jobs
2) A Yii2 Framework website
Both environments connect to an SQL Server database.
I have done all the steps to compile sqlsrv and added it to PHP's list of extensions. My scripts work great from the terminal, but on the website, I get an error:
could not find driver
My webserver is nginx, and it runs the website properly, but PDO does not connect to SQL Server.
I only have one PHP installation, but nevertheless used code to determine which is the right php.ini file in use and it has the right extensions directive.
A phpinfo() output also shows sqlsrv in the 'Registered PHP Streams' section.
My UFW firewall is inactive and I don't have SUSELinux. Nevertheless ports 22 and 80 are open. Even tried enabling it.
I am not sure what else to try. Help!
EDIT
I created a simple test file. When I run that through the terminal, it works, but when I do so via a browser, it doesn't.
EDIT 2
I installed Apache2 instead of nginx, and everything works now.
I think you need to try with just some "Hello world". If this not help type in terminal:
sudo apt-get install php-mysql
And restart your nginx server with:
sudo killall nginx && /usr/local/nginx/sbin/nginx

WAMP is not starting completely

I have latest version of wamp i.e WAMPSERVER (64 bit & PHP 5.5) 2.5 installed. It's not starting completely, not turning to green and so MySQL is not starting even though the port is used by Apache itself.
I have also installed Visual Studio 2012 VC 11 vcredist_x64/86.exe for my Windows 8.1 64bit OS.
Very weird, all the paths are configured in paths and also extensions enabled.
Below image specifies the sufficient ports in use:
#RiggsFolly - Thanks for the neat explanation. As per your questionnaires, I wanted to confirm that I have just installed 64 bit Wamp version and not 32bit. But installed Visual Studio 2012 VC 11 vcredist_x64 and x86 thinking.
FYI: As I had stated earlier in my question I have installed MySQL_Workbench in my system. But i have disabled its services to run on startup. May I know is that causing problem?
Please find the image of errors as per the MySQL Errors logs
And please find this for windows application MySQL error logs
My last question is: can't we have both MySQL_Workbench & Wamp together?
after you installed vcredist_x64/86.exe ,
you need to reinstall the wampserver. because the instalation of mysql services are not completed without vcredist_x64/86.exe and runtime
Your first image, I assume is the result of running
wampmanager -> Apache -> Test port 80
This tests the port that Apache should be using i.e. port 80. It should report
Your port 80 is not actually used.
But only if you have not started Apache!!! If you have started the Apache service in WAMPServer, it will of course report that port 80 is being used by Apache 2.4.9 etc etc...
This looks like what you have done! So its not a problem.
One thing though You say you installed WAMPServer 64bit, but the image reports that Apache 32bit is running ??? What do you really have installed ??? Or do you have both 32bit and 64bit WAMPServer installed?
If you have installed both 32bit and 64bit I suggest that you pick one or the other. I suggest the 32bit WAMPServer as the 64bit PHP is still not a complete port and considered Experimental until PHP7.
Now you appear to be saying already that the reason the wampmanager icon is not green is that MySQL has not started, so all the above is irrelevant. MYSQL runs on port 3306 and not 80, only one program can use a port, they cannot share ports.
So to see why MySQL has not started, look at the MySQL error log.
wampmanager -> MYSQL -> Error log
If that is empty, as it is sometimes if the error is so serious that MYSQL has not had time to open its log file before the error causes it to terminate, look at the Windows Event Log
To launch Windows Event Viewer do :
Windows Key + R to launch the run dialog
then enter eventvwr.exe and press the OK button
On the left side of the windows click 'Windows Logs -> Applications'
Look for the names 'Apache Service' or 'MySQL' in the Source column which have a error symbol in the first column.
The error messages in here are normally very descriptive and will normally lead you to a speciic line number in the my.ini file where the error exists. Alternatively, they will idedntify what the issue is.
Reply to additional info
Your MySQL error log is basically saying that it cannot start MYSQL as something is already listening on port 3306 (3306 is the default MYSQL port). Almost definitely the MySQL Server that you installed with the Workbench.
I see the installer for "MYSQL Workbench" has changed since I installed "MYSQL Workbench". I expect you chose to install MYSQL Workbench and a MySQL Server. As you have MYSQL Server installed with WAMPServer, can I suggest that you uninstall "MYSQL Workbench" or at least the "MYSQL Server" that came with workbench. This should stop the other MYSQL Server from getting port 3306 before the MYSQL Server installed with WAMPServer.
Remember to backup any databases that you may have created before uninstalling.
You can then install "MYSQL Workbench" again after WAMPServer starts working and this time dont install another instance of MYSQL Server.

XAMPP Apache not starting because of Apache2.4

So I'm starting to use MySQL and phpMyAdmin and I firstly installed Apache2.4. After installing Apache2.4 there were numerous errors so I decided to install XAMPP instead. Now me not thinking through the consequences deleted the Apache2.4 Folder completely along with all its contents.
So now when I start XAMPP, MySQL runs fine but Apache is stuck on "Attempting to start Apache service..." Now when I look at the services tab Apache2.4 is still on my list, I have disabled it but it's made no difference. I have checked through my computer for any remaining Apache2.4 files but I can't find any.
If anyone can help me with this, it would be extremely helpful!
UPDATE: I have restored Apache24 from my recycling bin, should I attempt a uninstall using cmd?
It appears that an instance of apache 2.4 is running on the system. It is probably locking port 80 which the reason why XAMPP apache is unable to start.
Shutdown apache 2.4 from it's control panel, shutdown the service, and ensure there is no "httpd" process running using task manager. If there is kill it.
Once the above are done you should be able to start xampp.
Follow those steps:
1- Uninstall Apache 2.4
2- Clean Windows Registry with a tool like CCleaner
3- Restart Windows
4- Install XAMPP

MAMP - Existing Apache and PHP

I'm very new to Mac OS, and also to MAMP.
So, Mac OS X comes preloaded with Apache web server, PHP, etc. I have a question regarding installing MAMP:
Will the PHP, Apache, etc that is installed with MAMP replace the preloaded ones? Or, will MAMP install a second instance of each of these?
Thanks!
MAMP is self-contained and will be run instead of the pre-installed Apache. You'll have to disable the "Web Sharing" feature in the System Settings to disable the builtin Apache server.
No, it won't replace anything. MAMP is entirely self-contained. All files live exclusively in the /Applications/MAMP folder and the Apache server runs on a different port.
MAMP is self contained. It does not replace the Apache, Mysql or any other thing in the computer or any original settings. It runs these services from its own folder with different port number. The original installation of Apache in MAC OS will continue to run on default port i.e.
Original Apache install will continue to run on
localhost:80
Mamp will install the service on the port port 8888, 8889 for apache, mysql. New MAMP Apache Installation will run on
localhost:8888
Uninstallation of these services from MAMP is simple as deleting the MAMP folder from applications

Categories