MAMP PRO + register globals - mamp

i've just started using MAMP pro, and whilst convertin all my Projects from ol' fashioned XAMPP to MAMP because of my switch from Win to Mac, i struggle with the php.ini-Options of MAMP Pro.
In special :
I have project which relies on register_globals. this is bad enough, i know, but nobody is going to pay for the kindness of removing this silly stuff.
But besides that, i can't get register_globals to work within MAMP, editing the php.ini with textwrangler and restarting the server does not have any effect. Also using File->Edit Templates does not do anything.
So, how can i get register_globals on with MAMP Pro. And yes, i tried .htaccess-ing ...
Thanks
Florian

Well, the only suitable way i found was :
Remove MAMP
Install VirutalBox + Windows
Get Back to an classical LAMP ...

I am using MAMP 3.0.6 and selected php 5.1.6 for a pretty much old project.
Opened the php.ini file at /Applications/MAMP/bin/php/php5.1.6/conf/php.ini and then did set register_globals = On
Worked like a charm.

You really shouldn't rely on register_globals, because it is completely removed from PHP 5.4 and higher!
If you really just need to make this project work, and get on with your life, you could make your own implementation:
function my_register_globals(){
$gpcs = array($_GET,$_POST,$_COOKIE,$_SESSION);
foreach((array)$gpcs as &$arr){
foreach((array) $arr as $k => &$v){
$GLOBALS[$k] = $v;
}
}
}
But my best recommendation is always to just scrap the project or rewrite if it uses register_globals!

Related

Typo3 messed up after backup restore

I fumbled around with an ancient T3 installation (tried an upgrade from 4.5 to 6.2) and before the fumbling created a backup from the entire directory on the webserver as well as the database.
Now I tried to re-activate that backup (a.k.a. 4.5). The install tool works fine, DB-Connection seems to be ok, but when I try to access the backend, it tries to access /typo3/sysext/install/Start/Install.php which isn't present at the described location.
I tried to delete all caches, emptied the typo3temp folder - nothing helps. It seems there's something stuck from the upgrade process, but I have no idea where.
Any ideas?
The Problem's solved. T3 6.2 uses the PHP Opcode Cache which can't be reset in the 4.5 install tool. Something must have been stuck there. I wrote a little PHP script that clears the cache and viola, it worked.
opcache_reset();

Reliable 'testing' server fails to open XAMPP

I have had a testing server on my computer for a couple of years. I have been trying to open it today and nothing happens.
I have tried to open my antivirus and added xampp to my allowed applications.
I have XAMPP attached to my toolbar and when I click it to open there is an underline like on the other open programs but I'm not getting the normal screen.
Any help?
Thanks, Bill
Hello I didn't get any answers but I figured it out on my own and wanted to share the results.
I ended up having to uninstall the original version and reinstall a new one.
Everything works perfect now.
Thanks,
Bill

phpmyadmin blank screen after installing Zend server

I installed LAMP on Ubuntu 12.0.4 LTE. Then I installed phpmyadmin. Everything was good. I used phpadmin to do lots of DB administration....
Then I installed Zend CE server. Now, phpmyadmin throws a blank page. No login screen.
So, I reinstalled my VPS in the same sequence again. No luck. Same behavior.
This time, I installed Apache, Mysql, PHP and Zend server in that order. Then I installed phpmyadmin....Unfortunately, still blank page on phpmyadmin.
Any help?...Thanks in advance.
First, for all those that posted their suggestions to my above issue, thanks!.
Of course, I had to dig deeper into forums and threads to find the specific root cause and solution for this issue.....and after spending few hours...finally, I resolved it!. Thanks to the following bug discussion link on php.net.
https://bugs.php.net/bug.php?id=25876
I tired many suggested fixes there but they didn't help. The suggestion that finally fixed the problem was pasted below ( so that let the credit go to the right owner):
[2011-03-03 12:18 UTC] comments at htmlcompressor dot com
If you are gettin the following error:
"Fatal error: session_start(): Failed to initialize storage module: files (path: ) in...."
Make sure that you have setup the session save path in your php.ini:
session.save_path = "/tmp"
which seems to be disabled by default.
I swear using Open Source software is tough!. I have spent whole day on this issue alone. My goal was to build some software and I have yet to get to it!!.

What should I configure when I put Zend project on windows to Ubuntu Lamp?

What should I configure when I put Zend project on windows to Ubuntu Lamp?
(I asking that beacause my Zend progect not working on Ubuntu, its gives first pages, but after i enter to next page its gives me 404 error(page Not Found), I check if rewrite mod enable with : sudo a2enmod rewrite and get: Module rewrite already enabled ::: I dont have such probelm on Zend Ce and Wamp servers on Windows).
Thanks,
Yosef
It almost sounds like the .htaccess file is not being taken into account. As a test you could try route this through index.php manually such as:
http://localhost/controller/action -> http://localhost/index.php/controller/action
This might help to narrow it down.
Double-check your class file names. Windows is a little more forgiving on case-sensitivity issues. It's quite easy to break an application written on a PC and transferred to a LAMP box with the wrong camel-casing on class files. I learned that the hard way.

How do you upgrade MAMP's PHP to PHP 5.3 ?

I haven't been able to find any resources on how to do this.. Anyone have any ideas or resources?!
I've tried changing the ./configure options and I'm solving things one at a time but it seems like this method could take forever.. My current error is..
checking for jpeg_read_header in -ljpeg... no
configure: error: Problem with libjpeg.(a|so). Please check config.log for more information.
I'm running Snow Leopard.
Any help would be great,
Matt Mueller
I know this is an old question- but still relevant.
I'm updating my MAMP and am keeping up to date on PHP's stable releases by using a guide I found at davidgolding.net
The Guide goes as follows:
First, run the
phpinfo()
function in a PHP script on your localhost or go to PHPMyAdmin and hunt down the configuration page. You should see a large chunk of configuration markup at or near the top:
'./configure' '--with-mysql=/Applications/MAMP/Library'
'--with-apxs2=/Applications/MAMP/Library/bin/apxs'
'--with-gd' '--with-jpeg-dir=/Applications/MAMP/Library'
'--with-png-dir=/Applications/MAMP/Library' '--with-zlib'
'--with-freetype-dir=/Applications/MAMP/Library'
'--prefix=/Applications/MAMP/bin/php5' '--exec-prefix=/Applications/MAMP/bin/php5'
'--sysconfdir=/Applications/MAMP/conf/php5' '--with-soap'
'--with-config-file-path=/Applications/MAMP/conf/php5'
'--enable-track-vars' '--enable-bcmath' '--enable-ftp' '--enable-gd-native-ttf'
'--with-bz2=/usr' '--with-ldap' '--with-mysqli=/Applications/MAMP/Library/bin/mysql_config'
'--with-sqlite' '--with-ttf' '--with-t1lib=/Applications/MAMP/Library'
'--enable-mbstring=all' '--with-curl=/Applications/MAMP/Library' '--enable-dbx'
'--enable-sockets' '--enable-bcmath' '--with-imap=shared,/Applications/MAMP/Library/lib/imap-2006i'
'--enable-soap' '--with-kerberos' '--enable-calendar'
'--with-pgsql=shared,/Applications/MAMP/Library/pg' '--enable-dbase'
'--enable-exif' '--with-libxml-dir=/Applications/MAMP/Library'
'--with-gettext=shared,/Applications/MAMP/Library' '--with-xsl=/Applications/MAMP/Library'
'--with-pdo-mysql=shared,/Applications/MAMP/Library' '--with-pdo-pgsql=shared,/Applications/MAMP/Library/pg'
'--with-mcrypt=shared,/Applications/MAMP/Library' '--with-openssl'
Copy and paste this whole chunk into your text editor and remove the single quotes (search and replace should do it). Look for the flag
--with-pdo-mysql=shared,/Applications/MAMP/Library
and replace it with:
--with-pdo-mysql=/Applications/MAMP/Library
If you don’t do this, you might end up with an error.
ld: symbol(s) not found
Finally, add the following flag to the end:
--without-iconv
After you have downloaded the latest PHP release of your choosing from PHP Sources Snapshots,
cd
to the downloaded directory in Terminal. Paste your reformatted configuration string (all of it, including the beginning ./configure command) and run it.
After the configuration phase is finished, run:
$ make
$ sudo make install
Relaunch MAMP, and you’re good to go.
The current version (1.9) of MAMP / MAMP PRO includes PHP 5.3 and is available on the MAMP download page.
This is bound to cause a lot of headaches. The simplest solution is to navigate over to the mamp website and grab the latest version of the application. Download it, hit the install button and you will find your php version has been updated to the latest version...
Hope this helps, I spent quite a bit of time fiddling about with upgrading PHP before I actually looked :S
I don't know if MAMP has changed its configuration in the last few years but none of the solutions here helped me. What I did, and what worked right away was:
Download the PHP version you want from MAMP
Unzip it and move the new PHP folder into the MAMP/bin/php folder where you will see other subfolders with names like php5.3.7
Restart MAMP
Go to the PHP panel under Server in MAMP and choose the new verion of PHP from the drop menu
Start MAMP.
reinstall whole MAMP is very safe. You dont even need to take a copy of old MAMP. the new install does it on its own. just feel free to download new MAMP and click install. only care u need to take is this
Edit httpd.conf and open up line to include vhosts.conf and copy old vhosts.conf from old MAMP folder.
Goto MAMP Download page
then choose
an update from the Heading
"Additional PHP versions for MAMP PRO 2.2"