WAMP server and PHP - php

I am using a WAMP server on a Windows Vista machine, and I am trying to do my first steps in PHP programming.
The problem is that the PHP include function dosn't work, and I don't know what the problem is! My code runs on other servers at work, but do not run in WAMP!

With WAMP server started try going to PHP > PHP Extensions from the taskbar icon and see if the extension that the function uses in enabled. Most of what you want should be available from this list.

Try to open php MyAdmin from Wamp - to make sure Apache is process is running - if not, nothing appears. If this is the issue, I would check if it could be problem related to port 80 (which happened to me). But if it DOES work, make sure that you use correct syntax for opening the php page as http://localhost/my_page.php

Related

One website showing as text on LAMP

I have a local install of Apache / MySQL and PHP on Fedora Linux.
I know PHP is running ok as some of my websites are running fine and if I create a simple file I can see I am running PHP 5.4.1.
Searching Google brings up tons of hits where the issue is PHP is not running at all but that isn't the case here - it's only one site that displays as plain text instead of processing as php.
I'm sure it's some kind of seeting in httpd.conf but have had a look and there is nothing obvious (to me anyway).
If some pages work and some don't check if it's a short_open_tag in php.ini issue. (it allows for <? instead of only <?php)

PHP on local files?

I don't have anything extra installed on my computer. Whenever I try to include one local PHP file on another, nothing happens. My question is if it should be working, or if I have to have some kind of server for it to work?
Well, you obviously need a server for a server side language... Don't you think?
Have a look at PHP servers such as Apache, or install an all-in-one such as XAMPP or WAMP.
At the very least, you need to install PHP and run it from the command line.

PHP wamp server error

I am pretty new on php particularly wamp. I got to access a live wamp server. PHP version 5.2.5. But my app needs to use PHP 5.3.0, so I just uninstall wamp from live server and install new wamp with PHP 5.3.0. Now the new installed server is not getting started. On starting it gives error that
php_pdo.dll file was not found. RE-installing app could fix problem.
Also the icon is still yellow. I want to know what the problem is with server and how this fix? Also is there some thing because of previously installed wamp server?
Pleas do tell me as it was live server so I need to fix things as quickly as possible.
Having PHP 5.3 you no longer need to have to activate PDO through the php.ini file. That means you're good to go using PDO natively.
This step is not necessary for PHP 5.3
and above, as a DLL is no longer
required for PDO.
http://www.php.net/manual/en/pdo.installation.php
It means that you didn't load the PDO extension. Do a right click on the WAMP icon in your task bar and under PHP menu enable the PDO extension. Restart wamp and the problem should be solved.
Click on the wamp server icon on your taskbar, go to Apache and you will find Test Port 80 in there. That will show whether port 80 is available or not. If not, go to httpd.conf file which is in the Apache menu of wamp server, find line Listen 80. Change 80 to 88. Restart All Services in wamp and that should work. Let me know if that helped.

PHP -> CLI has stopped working

I recently installed Windows 7 on my desktop and the following problem has begun occuring:
I regularly run some PHP scripts from the commandline that are now giving this error in a popup window:
CLI has stopped working.
I cancel this and my script terminates. Not good...
I've googled around and tried most of the few ideas suggested but still i am plagued by this annoyance. Right now it appears to regularly occur when I do a file_get_contents() of a url pointing to an image file. Only happens when the url is http protocol, works fine for ftp files. It also happens spuriously doing other things as well.
This is PHP 5.3.0 as distributed in a xampp 1.7.2 .zip. All exe's and dll's have been unblocked by copying thru FAT32 and back.
hints from anyone who's cracked this would be most helpful.
Try updating your PHP version bundled with xampp. You might have to update some php_XXX.dll extension files.
More info: http://web2.0entrepreneur.com/31/cli-has-stopped-working-on-windows-vista.html
PHP-CLI stops under these circumstances: Windows 7 64bit, PHP 5.6.8 64bit, only when Zend OpCache extension is ENABLED!!!
Just edit php.ini and comment zend_extension=php_opcache.dll (with ; in front of it)
I found that this happened to me when I had the APC extension enabled. I switched to using the Wincache for PHP extension instead.
If you receive this error after installing WAMP, most likely you have another installation of PHP on your machine. This may have been installed using the Microsoft Web Platform Installer or by other means. The first thing you should do is un-install PHP.
If this doesn't work, check to make sure that IIS and Apache are not trying to use the same port. WAMP starts out with Port 80 as standard and IIS usually will be the same. The easiest way to fix this is to turn off IIS while running WAMP, but you can set either of them servers to port 81 or another port.
If this doesn't work, my last suggest is to look for multiple copies of php.ini on your machine. You may find them in places like the Windows directory. Make a backup of the file just in case, and then remove them from all of the folders except the WAMP folder.
it happened to me in laravel 5.I searched every where but no solution that fix my problem then i debug my web application at different points and found that if you comment your php code in laravel comments in blade template like
{{--print_r($date_a);--}}
Now comment like this
//print_r($date_a);
works
The solution for me was to stop using PHP 5.3.0 and go back to 5.2.11. Once I did this the "CLI has stopped working" issue disappeared.
I have the same issue with Windows 7 Professional.
My Apache Server has no problem finding and executing PHP within my web application but the command line execution gives the infamous message "CLI has stopped working."
The User Account Settings seem to allow executions.
Perl has no problem.
I always have to take my code to an XP machine and run it there to debug it.
You didn't specify that you were using xdebug, but just in case you were, I may be able to help. I had this error for a long time. It turned out I was on a slightly older version of Xdebug (php_xdebug-2.2.0-5.4-vc9.dll).
I replaced that file with "php_xdebug-2.2.2-5.4-vc9.dll" and it magically started working immediately.
I'm on wamp, and I updated both php.ini files (one is for cli, one for normal use) with the latest filename.
"zend_extension = c:\wamp\bin\php\php5.4.3\ext\php_xdebug-2.2.2-5.4-vc9.dll"
Then dropped the new file into the php ext folder and instant success.
I had the same issue on Windows 7 (Home premium). I had a hunch that it is caused by one of the extensions I installed so I started commenting them out one-by-one.
Turned out it was caused by a non-compatible mongodb extension I was using
Edit php.ini and comment zend_extension=opcache.enable_cli=1 (with ; in front of it)
Try to use another php version instead.
It works perfectly for me.
Try to run scripts with php-cgi.exe instead of php.exe. For me it works.

Installing PHP, Apache 2.2.10 on Windows Vista

I am trying to get PHP working on my vista home machine but I am getting weird problems. First I had file permission problems for which I disabled Vista's UAC. Now I can't get the PHP interpreter working.
I have made all the necessary changes following some tutorial but I still can't get it working.
Tutorial was located here: http://www.tanguay.info/wamp/installPhp5.php5
Try XAMPP. I use that at home on a Vista machine and it worked nicely after the install.
WAMPServer is also a good option. You can easily enable/disable both PHP extensions and Apache 2 modules. Everything is set up somewhat securely (only local access to the serve), and you get phpMyAdmin already set up.
Only thing I've ever missed is Memcached, but that is fairly easy to set up on your own.
The only problem I have installing PHP and Apache on Vista is that you need to make sure that when you edit the httpd.conf that you are editing it as an admin, otherwise the file is saved in compatibility mode.
To overcome that problem just type notepad++ or whatever in your start menu, right click the item and run as administrator. Then open the file from the app.
You can use FastCGI for IIS 7. I'm using this also and it works perfectly!!
FastCGI
You can try Zend Core
It works on both IIS and Apache (it includes the installation of the Apache)
iis7 is one of the best web servers and especially for php, if you can't get it to work it means you need to google enough, because it isn't logical to blame Vista for php/apache issues

Categories