How to setup a PHP server? - php

I'm trying to set up a PHP server. We have an old server that runs a bunch of in house forms over an intranet that is coded in ASP, and I'm trying to rebuild that into a better system using PHP.
I'm starting fresh, as have been given a Win 2012 r2 server.
I first tried installing IIS 8. I installed downloaded the files for php (version 7). I was successful in being able to access index.html and any other files placed in the c/inetpub/wwwroot folder from a different PC via a browser (http://servername/file.php). However, I installed MariaDB and phpmyadmin. phpmyadmin gave the the message the mysqli extension is missing.
I ultimately uninstalled IIS, and PHP, and the MariaDB. I wanted to start from scratch, and tried with Apache
I was able to get Apache and PHP to work together, but I could not access files in the htdocs folder from a different PC (going to http://<servername>/file.php). I could only access it via localhost.
I had the same problems with phpmyadmin and mysqli.
I also noticed there was no php.ini file... rather I saw a php-ini-production and php-ini-development files.
How to I fix the phpmyadmin problem? Any advice for configuring apache so that I can access files place in the htdocs folder from a device other than the server itself (non-localhost)?

I recommend using XAMPP, then you'll have MySQL, and may be you could configure to use MariaDB as well.
If you use XAMPP, phpmyadmin is not available other than localhost, but that is configurable. If you want i can help you find a good video for that.

take the php-ini-production file and rename it to php.ini and find the line
;extension=php_mysqli.dll
and just remove the leading semicolon (;), save and restart apache.
Also you need to open the firewall on your machine to allow port 80 to accept all connections.

Related

Need help in configuring WAMP (phpMyAdmin)

So I have been looking on the net for hours now and I can't solve my problem.
I have wamp installed (WampServer Version 3.1.7 64bit).
I want to open phpMyAdmin through wamp. (I have the phpMyAdmin5.0.2 installed and phpMyAdmin.conf is configured).
I have several php versions installed.(this was done through the process of trying to fix the solution alone).
When I try to open phpMyAdmin I get this error message: [1]: https://i.stack.imgur.com/ZEMaX.png .
I have tried configuring php.ini file (by de-commenting mysqli) it didn't change a thing.
Here's my php.ini file joined in the google drive link: https://drive.google.com/file/d/1fQuVoh5vhRX-MHhYL3zMQ4xNkstO-4Ch/view?usp=sharing .
I have configured extension_dir tp the php/ext folder.
I have similary configured my windows path to the php/ext.
Nothing I try works. Any help is welcome.
Thank you.
Since you're using WAMP, which should include all the pieces you need already working, but also have several PHP versions installed, it sounds like you're installing more than you need which is causing conflicts.
Assume you have no data in your database or web pages that you need to preserve, I suggest removing everything; get rid of WAMP and any extra Apache, PHP, or MySQL/MariaDB installations you have. Clean up (delete or move out of the way) any leftover configuration files, then reinstall WAMP. If you have trouble after installing only WAMP and no other PHP installation, then report back here details of the error. WAMP should come to you working and all ready to go, so if there is a problem, it will be helpful to start from a known base installation without extra configuration files or executable that will cause conflicts.
I'll also point out that the very top of the file you posted states that it's used only for the PHP Command Line Interface, so this is not the configuration file used by anything running through your webserver (like phpMyAdmin or your site). It's a little confusing that there are really two PHP instances (one for the command line and one that runs through the webserver), but in this case you would be looking for the file in wamp/bin/apache/apache2.x.y/bin/php.ini

Phpinfo.php browser trying to download instead of running

HI I am trying to configure IIS7 to run PHP on a windows 2008 server machine.
I have followed this guide, php running on IIS7
Everything went well and I am sure it was working!!
However now when I try and run phpinfo.php the browser wants to download the page rather than running the script.
The handler mapper is configured the same as the the example. fastCGI/CGI is installed and enabled.
a normal index.html open no problem.
I have checked permissions, created a new empty site apart from phpinfo.php
I developed the site on my pc in a xampp environment where everything work great. First time I have tried to convert a site from xampp to IIS.
Their is no entry in the MIME Types, I am wondering if the WEB.CONFIG file is the issue but I don't know enough about what the file should/shouldn't contain.
thanks for any help
you can use http://php.iis.net/ to install php into your IIS setup. It comes with a manager to help you easily implement php in to your iis server and is way easier then trying to configure it manually. Hope this helps.

I have both WAMP and APACHE installed. Do i just need one or both?

I downloaded APACHE to use as a server on my local machine. I tested it by turning it on 'http.exe' I believe it's called. And storing a 'index.php' file that just says "It works". It showed this file when I went on local host on my browser.
I've downloaded My SQL work bench, and WAMP, and PHPMyAdmin.
My question is, do I need to uninstall Apache since my WAMP local server is on. Because when I type in local host in to my browser it takes me to the WAMP server configuration page, instead of showing "It works".
So does this mean I don't need Apache any more?
WAMP is basically Apache,php and Mysql package. Once it is installed you have installed these 3 and ready to go. You don't need separate one. Phpmyadmin also installed there.
Once it is installed you can have a tray icon in right bottom of the desktop. Use this menu to manage Wamp for eg: Start or stop Apace and Mysql, configure Apache,PHP and Mysql etc. Once you started the apache and mysql. Just type http://localhost in web browser to check the installation is ok or not. Remember C:/wamp/www is the webroot where your php files should go.
Wamp includes Apache, so you don't need a separate installation.
WAMP stands for "Windows Apache MySQL PHP"
So having WAMP means you have Apache, PHP, MySQL, PHPMyAdmin etc.
To run PHP code you need Apache server. And WAMP is an apache server environment. Same as LAMP (Linux version) or XAMPP (my favourite, stands for "Cross-platform Apache MySQL PHP Perl")

PHP, IIS, Oracle (OCI) not working

We are migrating from a Windows SBS 2011 to Windows Server 2012 R2.
We have an internal website that connects to our Oracle database using PHP.
I am trying to migrate this to the new server and so far I have:
Installed IIS Server Role
Installed PHP
Downloaded Oracle Instant Client to C:\instantclient
Added C:\instantclient to PATH System Variable
Added php_oci8.dll to php.ini and checked that PHP is actually using this php.ini
Restarted server
I am still getting error messages like oci_ commands not being recognised etc.
I'm lost. I've searched online and the instructions match what I have done from memory.
I haven't found a single thing online that I haven't done.
Depending on the version of InstantClient you have installed you might need to include the bin folder in the path, like so:
C:\instantclient\bin
To check if the DLL files are available in the path enter where oci*.dll in a command prompt. It should return a list of matching files.
Also, remember that just because your account can see the DLL files doesn't mean IIS/PHP can. That runs under a different account that might not have permission to access the files. Check your IIS error log and PHP php_errors.log file for any specific error messages.
Edit
After a rather lengthy chat, the problem was resolved by:
Updating the InstantClient from 10.1.0.5 to 10.2.0.5 (as mentioned in the module requirements: On Windows, the php_oci8 DLL needs Oracle client libraries from version 10gR2 or greater.)
Adding a copy of msvcr71.dll to the InstantClient folder.
Downloading and manually configuring PHP from php.net instead of using PHP Manager for IIS.
Ensuring the Path environment variable correctly pointed to the InstantClient and PHP folders.
try this:
extension=php_oci8_12c.dll
(instead of php_oci8.dll) - that is what I am using and you probably downloaded the same instant client as I did.

http://localhost/myphpadmin/index.php only shows code

I installed Apache onto my C: drive. (C:/Apache).
I then installed phpmyadmin and placed it inside a folder (htdocs) inside C:/Apache.
I followed a youtube installation example for Apache. When it asked me my domain name and server, I copied what the tutorial said to put, which was "localhost" for both fields.
After both Apache and phpmyadmin had been installed and set up, I tried accessing phpmyadmin, but all I got was a lot of code.
I am wondering, if, when I was installing Apache, if, I should have typed bravehost.com or my bravehost server name, instead of localhost.
When I try to access the Phpmyadmin login page (index.php), I only get a page full of code instead of the login page.
How can i do this ?
PhpMyAdmin will only work if you have PHP installed and linked to Apache as a recognized plugin by editing the httpd.conf file within Apache. If you have not done this, the browser has no way of knowing how to parse the PHP code. I advise directly downloading and using a WAMP Stack (like Zend, XAMPP or WAMPServer) which would have PHP, Apache, MySQL and phpmyadmin pre-configured. Would be easy for you to begin with.
Install php
Enable php and check through phpinfo()
Isntall mysql
Install phpmyadmin
After installation by default pma url is localhost/phpmyadmin (or what eve you setuped while installation). Remember that pma is only php scripts (it's not soft as apache\mysql\php).
If you see php code on pages it means that php is not working and apache give you 'raw' code. Re-check that your php is enabled and is working.

Categories