Using Ubuntu Server 14.04 x64 / PHP 5.5.9-1ubuntu4 (cli) w/ FPM / MySQL InnoDB version 5.5.35

Incredibly frustrated with what was supposed to be a minor issue. Basically, I'm being forced to recompile PHP from source (something I've never done nor had to do) to be able to execute a LOAD DATA query from PHP - something as simple as loading a CSV into a MySQL database programmatically which I mistakenly perceived to be mundane and everyday. (My previous question: https://stackoverflow.com/questions/24618135/mysql-still-cant-load-data-local-infile-path-to-file-txt-into-table-test-fi).

That being said... I have installed PHP-FPM and though there are countless tutorials on how to install any variation of PHP or PHP-FPM in Linux, the river starts to run dry when you have to properly remove your current installation and recompile PHP from source. I started in the direction of compiling my own from a tutorial when I received the following error (amongst hundreds of lines of verbose output):

configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing.

I needed to remove PHP and recompile with support for PDO::MYSQL_ATTR_LOCAL_INFILE => true? I ran the remove script for everything I installed with PHP and it looked like this:

sudo apt-get remove php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-fpm

So I think PHP is properly removed...

Also, it seems that I need other PHP extensions (such as mcrypt, php-gd, and others needed for WordPress/Magento type apps). Do these have to be compiled with them as well at the same time? If I come across another extension in the future, I assume that means I have to remove PHP again and recompile. This should be fun.

  • 1
  • Recompiling PHP isn't going to help you with this issue. Go back to your code and make sure you have actually done what was shown in the answer. – Michael Hampton Jul 7 '14 at 20:16
  • After actually doing what is shown in the link you provided, 508 lines of error ensued, the summary of which is PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1148 The used command is not allowed with this MySQL version. After more digging I had to first resolve with this: sudo apt-get install php5-mysqlnd And then this: apt-get install snmp-mibs-downloader Still much more complicated than it should have been but thank you for the direction which ultimately solved my problem. – sparecycle Jul 7 '14 at 20:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.