PHP APC and Imagick with cpanel - php

I currently purchased a dedicated server hosted at iWeb and got it administered by them.
I recently asked after registration to add php_apc and php_imagick to the available libraries. It seems according to them that it is not possible as it is not supported with cPanel.
I would apparently need to do that myself... is there any risks to install those two libraries ? What kind of problem could it raise if there is any ? In case I would have to debug this myself.

Installing Imagemagick to your system in itself won't be too much of a problem.
However, adding support for it and APC to PHP may be a tricky procedure; it may be best for you to just no longer use the PHP provided by cPanel and install PHP yourself, which will go into /usr/local, and run the configure script for it yourself, compiling in whatever extensions you need. It'll mean that you'll need to keep PHP up to date yourself, but it'll also mean that you won't have all your customisations to it wiped the next time cPanel upgrades it.
If there are better suggestions I'd also be interested to hear them.

Related

Is using Xampp/Wamp necessary or just a choice?

All the people I have seen working with php, were using Wamp or Xampp. And when I spoke with them as a fellow learner, their first question was which one I use(Wamp or Xampp).
Is Xampp/Wamp Server truly necessary to use or just my choice?
I first installed apache httpd server, then months later I installed Mysql community server and again months later php.I didn't plan to use them together, but now that I need to use them together, I am confused whether I should install Xampp/Wamp or it is fine without them.
Can serious and functional development can be done without using any of them?
I don't want to realize midway that I am going into wrong direction and it is not possible.I am not asking if it is recommended for ease of use or saving time. I have no trouble in learning to configure any of them and I have done so in past with very little trouble.
I would like to have an answer saying clearly whether I HAVE to use them, or they are just a matter of choice.
If you have done all the work of installing an AMP stack on Windows already then there is absolutely no reason to install WAMPServer or XAMPP.
These 2 products just make the process of installing a working AMP stack easier, they do not add anything over and above what you have managed to do all for yourself.
So when friends ask which product you use, all you need tell then is that you use a WAMP Stack that you installed and configured yourself.
I will add a couple of things though
WAMPServer does allow you to have multiple versions of Apache,MySQL and PHP installed in a way that makes it easy to switch versions of all 3 parts of the AMP stack very easily. In a development environment, I personally find this extremely useful. It means I can mimic a clients environment in a couple of seconds and at the touch of a couple menu items.
XAMPP does come with Perl.
If you want,you can download and integrate PHP in your invironment.
But if you want everything at one place then go for Wamp or Xampp.
Simple answer for the question is "it is just a choice". Because you can install all the software separately or all in one using WAMP/XAMPP

Compile PHP on Linux or use apt-get / yum?

I have been compiling PHP for years with the configuration options I want. I compile extensions I use from source. Is there an advantage to doing this versus installing it from a package manager like apt-get or yum. I assumed it would also give me a leaner binary. I noticed that their are PHP modules in the repos such as "php53-gd". What if there wasn't a package available for something I wanted such as cURL for PHP?
I understand the disadvantages of compiling such as needing to download/install dependencies based on my configuration options. I'm not really concerned with that.
So the question is:
Compile PHP on Linux or just use apt-get / yum? Can I get all the things I need from the repos? Does anyone out there still compile it from source?
Any insight is appreciated! Thanks.
I compile from source every time. It's not hard to corral the mentioned issues with regards to compiling manually. For example, my ./configure settings are saved to a file which is version controlled, so when a new version of PHP is stable and I am ready to make the switch, I download and extract the file, then run this command:
./configure `sh /path/to/my/configure/php.sh`
Not too difficult. And because it's in version control, I can add notes as to why a module was added or removed.
Another benefit of manual compilation is it allows me to keep the PHP footprint as minimal as possible. I pass the --disable-all flag, then add the modules I need. However, there is a downside to this minimalist approach, recently I needed to install Magento, so I had to recompile with --enable-hash and --with-mcyrpt flags. Even though I needed to add new flags, it wasn't difficult to add to the configure file and recompile.
Compiling from source has a few quirks:
There are hundreds of config parameters and flags. And you might not know the optimal ones that need to be used.
if you rely on apt-get's PHP, then you can be assured that you will get the latest patches and security updates if you set up auto-upgrade on your server.
the configuration of php.ini varies a lot. Sometimes your OS may decide some defaults for you which may work better with the rest of the system.
installing extensions like xdebug or other packages are a lot easier with apt.
However, it's worth compiling php from scratch if you want to learn. Also if you don't use some portions of it, you can always disable them in configuration - but then again it might not make much difference to performance.
I compiled php for specific needs only, like :
very small hard disk space so required a minimalist php version
and/or
need only a few specific modules or extensions
and/or
needed for a specific application
and/or
needed to optimize performances: when compiling on the machine where it's used, this allows some performance improvements, if using compile options to get a real tuned version for your system,
and/or
needed multiple and different php versions on the same machine.
and/or
I had a specific nux distro like only a busybox, so no other options than compiling.
But for common usage, e.g. in 80% of the cases, it's not worth spending time to compile and better using the repository version. But I learned a lot by compiling.
Personally, it's a matter of opinion. If you are in a hurry, apt-get it, if you have time to learn and possibly need to reinstall 20 times...compile it.
There are tons of guides out there for PHP compiling. It has a ton of flags for configuration, especially for GD and other libraries. Personally if this is for learning and development, just get LAMP or use apt-get...especially if you need to use Apache
I feel the primary reason for compiling is to have latest version binary (stable or nightly). package managers (most distors) are often annoyingly slow in this respect.
The other reason is that its very common problem that production systems are not wholesale upgraded using package managers. Even if that can be easy. Since package managers create dependency chains and you may not want to upgrade those items. So just to pick one item, compiling is an option. It keeps everything else as it is. You ofcourse have to always study the upgrade issues and make sure nothing else will fail.

Ubuntu server 11.10 and PHP 5.2 for use with Drupal 6

I'm trying to figure something out:
I am using Ubuntu server 11.10 virtualized on Win7 (I don't think that matters but more info is better than less) to work on a Drupal 6 website I inherited and need to make significant changes to.
I want to set up a development copy of this Drupal website on my Ubuntu server so I can work without worrying about torching the production website.
I successfully got the production files downloaded and onto my machine, I got the production MySQL database exported and imported into the dev MySQL server, and I set up a symbolic link from the directory /home/myname/thewebsite.com to /var/www/thewebsite.com so I can easily access it.
When I got the website they didn't know the admin password so I dug around online and reset it in the dev db using phpmyadmin and finally log in.
When logging in and poking around the site there are lots of errors, which when googled lead me to believe that PHP 5.3 is causing them and that there are some modules in use that only work with PHP 5.2
After looking around a lot online and on stackoverflow there seems to be no easy way to install PHP 5.2 on Ubuntu Server 11.10. With no packages for 5.2 available through apt-get or aptitude what should/can I do?
1) Install 5.2 from source - how do I get it to interface with MySQL and Apache2? Also, I've never installed anything significant from source. Is there a walkthrough?
2) Replace the repositories with old ones? Will this work on 11.10? The newest instructions I found were for 10.04
3) Use already built PHP 5.2 packages for Ubuntu? Couldn't find these
4) Pay someone who knows more to do it for me? (Just kidding, this isn't really an option...)
Cheers and thanks for your help!
PHP dropped support for 5.2 in August 2011; operating system providers such as Ubuntu will not supply a version that is out of support, so you absolutely won't get an official copy of PHP 5.2 on the current version of Ubuntu (or any other OS).
If you're running an older version of Ubuntu (eg 10.04), you might be able to do it; it would still be a downgrade, because PHP 5.3 has been the default version for quite a long time now.
If you're on a newer version of Ubuntu, ie 11.10 as you state, it is going to be a problem for you.
The Drupal developers dropped the ball badly on this one. I guess it was because Drupal 7 tool so long to finish; they were expecting D7 to be out much sooner, and so they never bothered fixing up D6 to work with PHP5.3. As it turned out, this was a big mistake, because in fact D7 still wasn't officially released when PHP dropped support for 5.2.
But even so, they should have fixed it, because they're still officially supporting Drupal 6, so they need it to work with the current version of PHP. This is definitely Drupal's problem, not PHP's, Ubuntu's or yours.
But you still need to deal with it.
I found this question over on AskUbuntu.com, which gives an answer applicable to 11.04. It isn't quite 11.10 you were asking for, but it it a lot more recent than the best you'd found, so it might be helpful.
Alternatively, you could research exactly what it is about Drupal6 and your specific modules that doesn't work in PHP5.3. The language differences between 5.2 and 5.3 that can break things are not big, so I would expect any code changes required to be fairly small. You might find you can fix the code yourself. And maybe even submit the changes to the community -- Drupal is open source, after all.
Another tack you could take is to consider whether this saga represents an opportunity for you to move the site to Drupal 7?
This may or may not be feasible, depending on the modules you're using, etc, but if it is possible, it will solve the problem, because D7 is of course fully compatible with PHP5.3.
And just to cheer you up, I'll close by mentioning that PHP are on the verge of releasing PHP 5.4. Hopefully the Drupal devs will be more on the ball this time.

cleaner way to install Apache, MySql and PHP on windows

I really say its a very hard time for me when started to install these 3 things on my windows 7 platform. I know there is WAMP available to install at one shot. But I for good understanding I want to install these 3 separately and want to integrate it. Why its so clumsy and difficult for integration? Can anybody please advise me how I can do the following?
Which latest versions of these 3 are best compatible?
After installing Apache what in which mode I should run it? Console application or Server Mode?
In apache whats the difference if I run with CGI or without CGI?
What the things or modules or any changes I have to ensure before going to install the MySql and PHP?
When I installed the MySql it tell me that MySql server is installed. Is the my MySql server is another HTTP server? Is it a replacement for Apache?
After I install the PHP what are the minimum things I should check so that I will be ensured that it will work with Apache after integration.
I found the logfile locations for Apache. But where can I find the logfile locations for PHP and MySql?
May be I am newbie in this domain so I am asking these questions. But it will help anyone who want to start newly. Please advise me...
Ok, I still dont see why you dont want to just install a package like WAMPP/XAMPP or Zend Server CE (personal favourite atm).
Put it this way:
Generally speaking, all latest versions are compatible, meaning,
latest PHP + latest MySQL + latest Apache
Typically server mode, but this really depends on what you want...
this is not something for noobs, again rather use a package
Do you want CGI? or not? Read the documentation on
http://httpd.apache.org/docs/2.1/howto/cgi.html
Dont bother, this usually isn't necessary - again use a package
Mysql is a Database Service
Browse to http://localhost/ if it works, then it works. Libraries depend on your personal needs, if you for example need php's
MCRYPT library installed, you'll know - install it... if it's
already installed, it will work anyway
Google it
I doubt this will help you much...

How can I avoid 'make install' when building PHP in Unix environment?

I'm attempting to rapidly deploy a PHP application under apache2/PHP on a Unix host. The sysadmin hasn't heard of PHP so I'm looking to build/install myself. Unfortunately root access is two weeks of bureaucracy away so I'm looking for a way to use PHP and its requisite libxml2 without installing.
You can be a non-privileged user and build Apache and PHP. You can have your own prefix paths for the installs, and if the development headers for the necessary libraries are available you can use them. You're going to hit issues in that as not-root you'll have to start Apache on a port > 1024. You're also not going to have the system package management available, so updates will have to be likewise built. In short, it's doable, but depending on which UNIX you're actually using, may not be horrendously pleasant. PHP in particular needs many many libraries (and if you're building from source, runtime isn't enough, you need the dev headers files) to have a usable system.
Good luck.
You can't avoid make install, but you can maybe use --prefix

Categories