How to install/enable GD in xampp windows [php 7.2]? - codeigniter

I Can't figure out how to install php-gd for PHP7.2. Is there any way to install/enable GD extension in xampp windows? I checked the php.ini file for php_gd2.dll but I can't find that line. It seems like GD is missing in PHP7.2. Any suggestions??

go to php.ini file
search this ;extension=gd
remove ;
then restart the server

Under xampp/php/php.ini look for "extension=gd2" and uncomment it, I presume this what you looking for

8 steps:
Open xampp control panel.
Start apache and mysql.
Click on config option of apache.
Click on php.ini and open it.
Press Ctrl+F and search "extension=" or "extension=fileinfo".
On the next line to "extension=fileinfo", add "extension=gd".
Save the file.
Stop apache and restart it.
You are done.
My PHP version is 8. if yours is 7 you may need to add extension=gd2 in php.ini file.
You can see your PHP version by searching for "localhost/dashboard" in the browser and then clicking on "PHPinfo" at the top right.
if ";extension=gd" is already there, remove the semicolon and save the file and restart Xampp.

open XAMPP control panel
click Apache config select PHP(php.ini)
ctrl + F , so search for gd
you should see a line like ;extension=gd
just remove ; and save it
stop apache and restart
Your XAMPP now has GD enable

I had to add the absolute path to the extension as well:
extension=gd
extension=C:\xampp\php\ext\php_gd.dll

open xampp
in apache server click config - php.ini
go to php.ini file
ctrl + f to search this ;extension=gd
remove ; then restart the server

Also for windows user if you have multiple xampp installed check which php ini is being used by composer by using command
php --ini
if its not the one you are using u can try uninstalling the undesired one and then trying again

Related

Mac apache2 local host and reinstalling

after all kinds of editing :( :/ yea....
1: localhost will open it works! and when you refresh the page it does not work and refresh the page again and it shows up again.
2: even after running sudo apachectl stop localhost still shows it works
3: running in terminal jobs shows 9 sudo vi /etc/apache/httpd.conf
4: at one time https.config had php7 now only shows php5 after some other edits
?????any way to complete just remove apache and reinstall the hole apache?????
after a lot of editing files around found out the solution was:
for
#3 on unix ie Mac
1....( run the command in terminal) rm .httpd.conf.swp
2.... (then going back in and editing files as follows run ..... )
nano /etc/apache2/httpd.conf
3.... (change the text of ((LoadModule php5_module libexec/apache2/libphp5.so)) just change the 5 to a 7 then hit control o then enter then control x
4.... run. apachectl restart and open web browser run localhost
now if you want php add the phpmyadmin folder downloaded from phpmyadmin
first rename the folder to phpmyadmin after it has been unzipped and move it into the folder located at your Mac harddrive/Library/webserver/document you should also see your index.html.en
by the way editing this index.html.en file will let you know when you run localhost if this is intact the location it is rendering. another problem some have if they use other things like node.js mongodb and so forth and or files moved around.

Unable to find htdocs on xampp

I have installed XAMPP for macOS Sierra.
I have one icon in application for XAMPP.
I am able to run the server & it's services but I am not able to find the htdocs folder.
I have not found it under \Library\Webserver
I was able to find the htdocs directory. On mac,Under volume tab there is button called 'explore' from there there is the directory.
Just found out that XAMPP nfs mounts on MacOS are located in following path:
/Users/my_name/.bitnami/stackman/machines/xampp/volumes/root/htdocs
The new version of XAMPP uses a VM for its content, you need to mount the Volume to access htdocs.
More info about differences between old XAMPP and XAMPP-VM:
XAMPP-VM for Mac
In other to locate the right and active htdocs directory of your XAMPP for macOS Sierra, follow the three steps below;
Launch your XAMPP and click on the "Start" button,
Wait for the Status indicator bubble to change from the orange colour to green, then click on the "Volumes" tab (between the "Network" and "Log" tabs),
Proceed to click on the "Mount", then "Explore" button;
From the resulting window, you can easily locate your htdocs folder.
More details available here.
Delete the xampp.app, download the new one(I use 5.6.31 php ver) then reinstall it.
You can also mount it on your own mac :
hatem#Mac:/opt$ sudo mkdir lampp
hatem#Mac:/opt$ sudo mount -t nfs -o resvport,rw 192.168.64.2:/opt/lampp /opt/lampp
Then ls and you will find the entire lampp from the VM mounted locally.
I found out that the NEW xampp has file explorer link on it click it and boooooooooom htdocs is there
/Applications/XAMPP/xamppfiles
That's where you will find htdocs.

How to remove the build-in PHP5.5 with Mac OS10.10 (PHP CLI) and use XAMPP(PHP5.3)

I installed XAMPP with PHP5.3, but now on command line, php -v always uses the Mac OS10.10 build-in PHP5.5! But I need to use PHP5.3 instead. How to config so that I can use XAMPP PHP 5.3?
I tried to modified /etc/apache2/httpd.conf to load XAMPP's PHP module, but doesn't work.
PS, I need to change the command line PHP version as I need to use Symfony 1.x version(need to run symfony commands from command line)
You just need to add the path to the XAMPP php binary to your path. You can edit your .profile to add the path:
vi ~/.profile
This will open a new vi screen in your terminal then type :$ and hit return; That will take you to the last line. Then do CONTROL+A to append to the last line. You can now enter text and add the following:
export PATH="/Applications/XAMPP/bin:$PATH"
Then press ESC; This will take you out of editting mode. Then type :wq and hit return. That will save the file and quit vi. Then you can enter this command to load your profile (or you can just close terminal and reopen it or open a new tab):
source ~/.profile
Now if you enter the following command on the command line you should see the XAMPP version of PHP:
which php
You could change the symfony command of your project directly, so you can change the php version by project. Add the following in the first line of the symfony file:
#!/usr/bin/env /Application/XAMPP/bin/php
Now symfony uses the given php binanry, not the one of the system.

Add MySQL to existing XAMPP installation

I installed XAMPP with only Apache and PHP and now I realized I also need MySQL. I downloaded a XAMPP installer and ran it, but it won't install in C:\xampp as it already exists.
How can I add MySQL to the existing Apache+PHP installation?
Here is how I did it:
Re-run the installer and install with MySQL into a different folder. (These instructions assume c:\xampp2)
After the installation finishes, move the mysql directory from the new install into the old install. (I moved c:\xampp2\mysql to c:\xampp\mysql) You can then delete the second installation folder.
Be sure xampp is not running and edit c:\xampp\xampp-control.ini, looking for the [EnableModules] section. Set MySQL=1.
Restart xampp. The MySQL buttons should be enabled. Click the Config button next to MySQL and edit the my.ini file. Do a search and replace, changing all instances of xampp2 to xampp.
Now you can hit start, and MySQL should start up. Note these instructions assume c:\xampp is your desired install location, adjust accordingly.

Timezone with symfony 2

I've got some troubles whith Symfony 2, trying to generate schema via :
php console/app generate:schema:create
I've got a pretty error :
[Exception]
DateTime::__construct(): It is not safe to rely on the system's
timezone settings. You are *required* to use the date.timezone
setting or the date_default_timezone_set() function.
In case you used any of those methods and you are still
getting this warning, you most likely misspelled the timezone
identifier.
We selected 'Europe/Berlin' for 'CEST/2.0/DST' instead
Thus, I'm trying to change the timezone in my php.ini with
date.timezone = 'Europe/Paris'
but even if I'm reloading my apache, I still get
date.timezone Europe/Zurich Europe/Zurich
if I look at my phpinfo(), so I don't really know what should I try next ... And I'm not even sure that I'm in the good way.
Thanks for helping me
On mac, if you have /etc/php.ini.default, do
sudo cp /etc/php.ini.default /etc/php.ini
and then do
php --ini
to see that it now loads a php.ini file.
this that trick
and se /etc/php5/cli/php.ini and /etc/php5/apache2/php.ini
datetime = 'America/Lima' for example
and run command
$ sudo apt-get install php5-sqlite
$ sudo /etc/init.d/apache2 restart
Some third-party distributions of PHP (including MAMP) have hard-coded the timezone. For instance, MAMP 2.0 is hard-coded to Europe/Berlin, and there is no way to change this. Even changing the value in the php.ini template has no effect, because MAMP overwrites your value. Are you using PHP from source, a pre-compiled package, or PHP as a part of some kind of LAMP stack?
If you are on debian based, you must modify the parameter in the file /etc/php5/cli/php.ini, changing it in /etc/php5/apache2/php.ini has no effect.
I know this is an old ticket, but since I was having a problem with this too, and it's still open I thought I'd share my quick 'n' dirty solution:
In my case, date.default was not set at all and I wasn't in a position to change php.ini. So, as a stopgap I added date_default_timezone_set('Europe/Dublin') at the start of web/app.php to change the timezone at runtime, which worked nicely for me.
If you're using the console to run any commands you will probably have to add the call to the the top of this script also.
I ran into this problem with my shared host. they told me I couldn't change time zones via php.ini, but you can try an .htaccess file instead.
create the .htaccess in the folder where Symfony is installed and put the following code in it:
SetEnv TZ America/Sao_Paulo
hope this helps.
cheers,
Luciano
For Windows, I installed XAMPP for the webserver and downloaded PHP and installed it so that I could run the symfony commands from command prompt.
In this case, the php.ini file used when I execute a Symfony command is located in C:\Program Files(x86)\PHP\php.ini. You have to have admin rights in order to edit this file, so I launched Notepad++ as administrator and opened the file.
Look for date.timezone and modify it according to your timezone e.g. date.timezone = Africa/Nairobi. Timezones are listed on the php website, just search php, timezones. No need to restart your computer or webserver.
I just encountered this problem with XAMPP on Mac 10.11.5, PHP 5.6.8
My error read "Warning: date_default_timezone_get(): Invalid date.timezone value 'America/Los Angeles',"
I fixed it by finding the only problem was the missing underscore in the "Los Angeles" entry for my PHP.ini date.timezone setting.
Try to execute this command:
sudo ln -s /usr/local/php5/lib/php.ini /etc/php.ini
Mac in my case.
First - config path, second - don't change.

Resources