My site had worked great untill I updated its php version to 5.4.4 (I also tryed 5.3), I can't continue using php v5.2 because I have added some function that are not supported in 5.2 version.
I work on a windows server.
Profile your PHP with xdebug.
You can see PROFILING PHP WITH XDEBUG AND WEBGRIND, the main parser of xdebug files (kcachegrind) is native for Linux.
An alternative is windows port of kcachegrind, but I never tried it.
XHProf is another simple tool for Profiling
It's very simple to use and configure.
Related
I am returning to php after a long time (although I have a very basic understanding of php in general), and understand that I can run a php server locally by running the command now with version 5.6:
php -S localhost:8080
Do I still need to install XAMP or WAMP as many of the online tutorials are suggesting or am I okay to just use the above command?
Note: I have postgresql installed on my computer already and do not use mysql, if that matters at all
You need a webserver which you prefer depends on you. XAMPP is the most used for private but you could also take a look at BigApache, EasyPHP, PHPTriad, MampServer, WampServer.
Xampp is a combination of below
Apache server
Mysql server
PHP
and others.
This is a pretty famous and most used package. But if you want to install everything manually then thats even better you can control your server in any way you want. Go for it and you will learn more about it.
If you want a very flexible development environment you need to use a package like EasyPHP Devserver (http://www.easyphp.org/) or equivalent.
Basic Info - Running WAMP 2.2 with PHP 5.4.3 and Apache 2.2.22 on Windows XP Pro 32 bit
My problem is that when I run a php script it will run just fine. Now if I change that script and re-run it, the page will never load and the script will become locked due to being used by another program. I have found that it is being used by the process httpd.exe, which if I use End Process (Which actually restarts it rather than stopping it) the original page will suddenly load and the new script will be ran. If I change it again it will do this same thing.
If I disable the PHP APC extension this problem doesn't happen, so it is caused by APC
I have tried using php_apc_3114_beta_php54.dll (renamed it to php_apc.dll) downloaded from http://dev.freshsite.pl/php-accelerators/apc.html "APC 3.1.14 beta for PHP 5.4" and apc_3113_beta_php54_vc9.dll (renamed it to php_apc.dll) the same place "APC 3.1.13 beta for PHP 5.4 vc9"
I would suggest to download PHP extensions from specific sites only. The extensions should be compiled for your specific PHP version and system (check for x86/x64 and thread-safe vs non-thread-safe). The best places to download correctly compiled extensions for windows are:
PHP for Windows:
http://windows.php.net/
http://downloads.php.net/pierre/
and Anindya's Blog:
http://www.anindya.com/tag/php/
http://www.mediafire.com/php-win64-extensions
EDIT: As mentioned below in my comment, have you tried using BOTH versions of APC (thread safe AND non-thread-safe) from the original site you linked to?
This does sound like some sort of threading issue...
I did myself a favor and did it all on Linux. Setting up my whole server and installing APC on Ubuntu was faster and smoother than just trying to insert APC in WAMP. After a few commands and a clean install it's working beautifully, I can't believe I didn't migrate to Linux sooner!
I am working on an older project that uses functions not supported by the newer PHP version included in my version of XAMPP.
I want to temporarily change to an older version of PHP, so I'm looking for a way to switch between PHP versions in XAMPP.
Unfortunately, refactoring to use the newer version of PHP is not an option.
I would not dare to 'temporarily' shift my development machine.
I would suggest installing a virtual machine manager like VirtualBox and then install a older version of XAMPP in there.
I am really disappointed with the responses on this.
WAMP allows you to switch between PHP and MySQL versions pretty easily...
I did following steps on Windows:
Download your XAMPP with your desired PHP version (the VC-11.zip version)
Unzip on C:/xamppXXXX/ (XXXX -> Your PHP version, for example), so you'll have both C:/xampp/ (your first installed version) and the new.
3a. Find in all .conf, .ini, .bat files from the xamppXXXX folder /xampp/ and replace for C:/xamppXXXX/. You can use any IDE like SublimeText to find the string.
3b. Find in all .conf files from the xamppXXXX folder \xampp\ and replace for \xamppXXXX\
You can start MySQL from your installed version control panel and open the C:/xamppXXXX/xampp-control.exe and launch Apache from this one.
I did this with php7 installed and php5 from zip and working fine. Opening different instances of XAMPP Control Panel is the best way to have all databases together and not losing them between versions.
Dont' use XAMPP for this. Use MAMP. It's a single click
There is a bug in php 5.3 with the iconv module. Apple applied a patch for their version of php. However, MAMP didn't include this patch and is thus unusable with Zend Framework (for example).
I tried to include Apple's version of php 5.3 into the MAMP's httpd.conf, but ran into problems with symbols which could not be found. Does anyone know of a proper way to use MAMP with php 5.3 /w iconv? Is recompiling or linking apple's version an option?
Just rename the php directories in /Applications/MAMP/bin/php
Duplicate php 5.3 directory and rename it to the same ver number of 5.2, and it works. :d
I'm not sure this leave a whole lot of value in the MAMP, but you probably are best served compiling your own php and apache.
http://fabien.potencier.org/article/37/php-5-3-0-on-mac-os-10-6-snow-leopard
There is a discussion of this issue here:
iconv_strlen function causing execution timeout, running on MAMP
The basic solution is either to downgrade your MAMP to version 1.9.4 which is the last stable version as far as “iconv” is concerned. Or you can use any version of MAMP from 1.9.5 onwards but switch the PHP version from the MAMP preferences from 5.3 to 5.2.
I tried easyphp but i think it's not enough, I want an Apache / PHP / MySQL installer which has the latest PHP and MySQL version, and with curl and htaccess support.
Opensource solutions are preferred, should be windows vista compatible.
I have never heard of a PHP / mySQL emulator. What purpose would such a tool serve?
If you are looking for a ready-made installer package for Windows, containing everything necessary to install and run PHP, XAMPP is probably one of the best ones around.
WAMP Server is excellent, easy to install and easy to configure:
http://www.wampserver.com/en/index.php
If you want the last version of each piece of software, and to really do it the way you want, the best solution is to download an install each component separatly :
Apache : http://httpd.apache.org/
MySQL : http://dev.mysql.com/downloads/
And PHP : http://www.php.net/downloads.php
Of course, you'll have a bit more work to plug all those together than if using WAMP or anything like that -- but it also mean you'll know more about how they work and can be configured, which is always nice to know ;-)
Never heard of PHP or mySql emulators before. To run a php script you will need a webserver and the PHP engine to parse and execute the script. This cannot be emulated by another engine besides PHP.
I would suggest using Acquia Dev Desktop.
It installs Apache, MySQL & PHP with one click. Most importantly, unlike many other WAMP stacks, it works well under Windows Vista (32- or 64-bit). And as an extra, it installs Acquia Drupal for you as well, so if you ever want to get into Drupal development, you have everything you need to do so.
Get it at http://network.acquia.com/documentation/acquia-drupal-stack
I'm a BitNami developer and I personally suggest to use BitNami WAMPStack. It is free, it also includes phpMyAdmin for managing the MySQL databases and GUI management tool for the servers. Per your requirements, it is open source, compatible with Windows Vista and Windows 7, includes curl and htaccess support and we keep it fairly up to date.
XAMPP Lite USB
"XAMPP Lite" is an additional extra small XAMPP edition. Configured with relative paths you can use it on usb devices.