How to configure Apache for PHP on Windows 7? [closed] - php

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have installed Apache 2.0(httpd-2.0.64-win32-x86-no_ssl) and it works, then I have installed Php5.3 and it pointed to Apache configuration folder.
failed scenario:
1- create simple test.php, put in under C:\Apache\Apache2\htdocs
2- call "http://localhost:8080/test.php" --> "Bad Request..Your browser sent a request that this server could not understand."
Proposed solution by NetBeans blog (failed)
1-add those two lines to httpd.conf
AddType Application/x-httpd-php .php
LoadModule php5_module "c:/php/sapi/php5apache2_2.dll"
It doesnt works because there is no "php5apache2_2.dll" under my Php installation folder??
I have such .dll : php5ts.dll, ssleay32.dll,..
Any one have any suggestion in order to run the PHP script successfully?

It would probably be easiest to just download WAMP or a similar all-in-one web server, especially since your environment is most likely not a production environment.

Just download php5apache2_4.dll-php-5.3-win32.zip from http://www.apachelounge.com/download/
Here is a guide how to configure your apache to work with PHP 5.4

I know this is not what you asked for but why to use WAMP? First of all it's not a good idea to integrate you desktop with DEV environment (it gets messy quickly). Windows is not a natural environment for web application.
Get yourself a VMWare player (it's free) and install Ubuntu Server on it. Now you can work from Windows on your Linux server. You can also get your VMWare environment home if required.

Related

PHP8 not working with Apache httpd localhost in Mac OS 12 [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
Upgraded to Mac OS 12 today and noticed PHP was removed. Have installed PHP 8 using brew. I've tried setting it up with the default httpd and also tried installing it with brew. I load the module in the config. In both cases, when I access the files on the localhost in my browser, it just prints the text in the php files and doesn't execute them. Haven't really got any clue left
You need to add the line AddType application/x-httpd-php .php to httpd.conf Apache configuration file to enable PHP file parsing. After editing the file restart Apache to reload new settings.
You can use an alternative like MAMP (My Apache MySQL and PHP). Installation instructions here: https://documentation.mamp.info/en/MAMP-Mac/Installation/.
It includes a prepackaged Apache/nginx web server, PHP and MySQL, as well as, a management GUI app native to macOS.

Laravel setup projects on personal web server [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I have at home a personal web server running apache where I have a /var/www/{project_folder} to serve my websites, where I access them by the other machines by the IP/{project_folder}, nothing new for now. :)
I have some new projects done with laravel, but I only run them at my local machine to use the cli command to serve where it always runs at localhost:{door}
I would like to put that projects at my web server but I'm facing some difficulties because I only have some basic knowledge about apache and I'm having trouble to figure out the configuration.
I believe someone have already done that :)
Thanks in advance.
Assuming that you already have PHP working with Apache, so your httpd.conf file is fully configured so that if you have a file ending with .php will be handled properly.
All you have to do now is place your project in the htdocs folder where you have all normal project in. That's it.
You could install composer and install Laravel with it. For example via
"composer create-project laravel/laravel --prefer-dist".
See here
Now the tricky part:
If you want to access the site via http://localhost/your-project and not via http://localhost/your-project/public, then do this (depending on you OS):
Activate Mod_Alias
Goto '<IfModule alias_module>'
Then add this line inside:
Alias /your-project/ "C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/your-project/public/"
In this case you don't need virtual hosts.
Let me know if you have further questions.

upgrade PHP from 5.3.3 to 5.3.8+ on windows [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have been using PHP 5.3.3 for awhile and have customized many things in php.ini and added some extra extensions. how i can upgrade to 5.3.8+ without leaving installed extensions and php.ini configuration?
Just make a backup of your php.ini and copy it over when you're done upgrading. As to extensions, if they're built-in extensions (or if you're using something like WAMP, XAMPP, or Zend Server that bundles the extensions you need) then you shouldn't need to do anything else, but if not then those extensions will need to be recompiled for the new version of PHP (make sure you download the latest release of the extension for PHP 5.3.x first). Many extensions can be installed using PECL, which makes things a bit easier.
There is a directory called PHPRCDocs on your disk. Set it to the version you want to have actively supported.
Also take care that the windows %PATH% environment variable point to the PHP installation you want to use by default on the system if you want to use it in command-line-interface.
If you have a webserver configured, look into your websevers documentation how you specify the path to the PHP webserver module, Fast CGI Process manager or CGI executeable. It also needs to point to that path.
Alternatively to install into a new directory you can also rename the old PHP directory and create a new directory with the same name as the previous one. PHP configuration is based on ini-file, so you can have multiple versions on the same system next to each other easily.

Issues with Apache and PHP [ubuntu] [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I just installed PHP and Apache2 on my laptop (ubuntu 12.04), but I can't get my PHP files to load. I have followed this tutorial: http://www.howtogeek.com/howto/ubuntu/installing-php5-and-apache-on-ubuntu/ , and the index.html file works, but when I try any php, I get a server error.
I looked online for a few hours, and I added "AddType application/x-httpd-php .php" to my httpd.conf (but I don't think I'm supposed to be editing that file for the ubuntu version??) in /etc/apache2/, which somehow let ONE php file load (which just contains phpinfo()). I then tried making a new php file with the same code, but that one won't load (server error). I have no idea why it only loads that specific file. I have tried restarting apache and opening the other one first, but for some reason, it only loads the first file. I also tried to move the file to another directory in /var/www/, but not dice. I hope this makes sense, because I'm a beginner here.
any help would be appreciated!!
I think you didn't install the last version of php, try to install php5
apt-get install php5

installing php mysql installation on windows 7 with iis [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
im installing WordPress on my local host for development purpose.
i have installed php and verified it is working using
phpinfo();
I have also installed MySQL on my machine.
I have unmarked MySQL.dll
Unmarked MySQL.dll extension on my PHP.INI file and restarted IIS.
now once i go to the WordPress installation address im getting :
HTTP Error 500.0 - Internal Server Error
is there another settings im forgetting to deal with ?
Just get IIS Express with Web Platform Installer. You'll find PHP in the list there and URL Rewrite, PHP WinCache and more utilities. IIS Express is better for local dev than IIS as it's lighter on the permissions that it needs.
Read here IIS Express vs Default IIS that comes with Windows 7 ... you might have issues this your permissions and that's a major PITA to handle. I always eventually set IIS up properly but can never actually tell what I did :) on the permissions side.
Apache on Windows is not as fast as IIS. But if your hosting is Linux, you might want to use it to get acquainted to .htaccess Rewrites and overall rules too.

Categories