ამ პოსტში მინდა მოგითხროთ პატარა ისტორია Mac OS X – ზე PHP – ს რეკომპილაციით მიღებულ “სიამოვნებასა” და უსაზღვრო “კომფორტზე” რომელიც ბოლო ორი დღის განმავლობაში მივიღე.
მაშ ასე, თუ თქვენ იყენებთ XAMPP – ს და გესაჭიროებათ PHP – სთვის tidy გაფართოვების დამატება რომელიც სამწუხაროთ XAMPP – ს არ მოყვება, გაგახარებთ და გეტყვით რომ საკმაოდ სერიოზული პრობლემის წინაშე დგახართ
რა არის საჭირო ამ მიზნის მისაღწევად? მივყვეთ ნაბიჯ ნაბიჯ:
- შეინახეთ ყველა არსებული პროექტი უსაფრთხო ადგილას;
- გაანადგუროთ ყველა არსებული PHP ინსტალაცია, ამისათვის ტერმინალში აკრიფეთ შემდეგი ბრძანებები:
sudo rm -rf /Applications/xampp sudo rm -rf /usr/include/php sudo rm -rf /usr/lib/php
- გადმოწეროთ XAMPP ის ბოლო ვერსია და დააინსტალირეთ;
- გადმოწერეთ XAMPP – ის დეველოპერ პაკეტი ნებისმიერ ადგილას, შედით შესაბამის კატალოგში და დააინსტალირეთ შემდეგი ბრძანებით:
sudo tar xvfpz xampp-macosx-0.7.4-dev.tar.gz -C /Applications/xampp
- გადმოწერეთ PHP 5.2.6 – ის დისტრიბუტივი და გახსენით არქივი ნებისმიერ მისამართზე, მაგ:
/Users/iosebdzmanashvili/Documents/PHP/php-5.2.6
- გაუშვით XAMPP, შექმენით ნებისმიერი PHP ფაილი და გამობეჭდეთ phpinfo.
მიღებული რეზულტატიდან დააკოპირეთ და შეინახეთ კონფიგურაციის პარამეტრები, ეს ნაბიჯი აუცილებელია არსებული კონფიგურაციის შესანარჩუნებლად. ორიგინალი დაახლოვებით გამოიყურება ასე:
./configure --prefix=/Applications/xampp/xamppfiles --program-suffix=-5.2.6 --libdir=/Applications/xampp/xamppfiles/lib/php/php5 --includedir=/Applications/xampp/xamppfiles/include/php/php5 --with-apxs2=/Applications/xampp/xamppfiles/bin/apxs --with-config-file-path=/Applications/xampp/etc --with-mysql=/Applications/xampp/xamppfiles --disable-debug --enable-bcmath --enable-calendar --enable-ctype --enable-dbase --enable-discard-path --enable-exif --enable-filepro --enable-force-cgi-redirect --enable-ftp --enable-gd-imgstrttf --enable-gd-native-ttf --with-ttf --enable-magic-quotes --enable-memory-limit --enable-safe-mode --enable-shmop --enable-sigchild --enable-sysvsem --enable-sysvshm --enable-track-vars --enable-trans-sid --enable-wddx --enable-yp --with-ftp --with-ncurses=/Applications/xampp/xamppfiles --with-gdbm=/Applications/xampp/xamppfiles --with-jpeg-dir=/Applications/xampp/xamppfiles --with-png-dir=/Applications/xampp/xamppfiles --with-freetype-dir=/Applications/xampp/xamppfiles --without-xpm --with-zlib=yes --with-zlib-dir=/Applications/xampp/xamppfiles --with-openssl=/Applications/xampp/xamppfiles --with-expat-dir=/Applications/xampp/xamppfiles --enable-xslt=/Applications/xampp/xamppfiles --with-xsl=/Applications/xampp/xamppfiles --with-dom=/Applications/xampp/xamppfiles --with-ldap=/Applications/xampp/xamppfiles --with-gd=/Applications/xampp/xamppfiles --with-mysql-sock=/Applications/xampp/xamppfiles/var/mysql/mysql.sock --with-mcrypt=/Applications/xampp/xamppfiles --with-mhash=/Applications/xampp/xamppfiles --enable-sockets --with-curl=/Applications/xampp/xamppfiles --enable-mbregex --enable-zend-multibyte --with-zip=/Applications/xampp/xamppfiles --enable-exif --with-sqlite --with-libxml-dir=/Applications/xampp/xamppfiles --enable-soap --enable-pcntl --enable-dbx --with-mysqli=/Applications/xampp/xamppfiles/bin/mysql_config --with-bz2=/Applications/xampp/xamppfiles --with-ming=shared,/Applications/xampp/xamppfiles --with-pear=/Applications/xampp/xamppfiles/lib/php/pear --with-mssql=/Applications/xampp/xamppfiles --with-imap-dir=/Applications/xampp/xamppfiles --with-imap=/Applications/xampp/xamppfiles --enable-mbstring=all,/usr --with-gettext=/Applications/xampp/xamppfiles --with-pdo-mysql=/Applications/xampp/xamppfiles
ახლა იწყება ყველაზე საინტერესო და არასასიამოვნო პროცესი რომლის გარკვევაზეც არცთუ ცოტა დრო დამეხარჯა:
- გახსენით ფაილი:
/Users/iosebdzmanashvili/Documents/PHP/php-5.2.6/ext/tidy/tidy.c
მოძებნეთ გახსნილ ფაილში #include “tidy.h” და გადაიტანეთ იგი ფაილის დასაწყისში.
-
tidy – ს xampp – ში დასაკოპირებლად ტერმინალში აკრიფეთ შემდეგი ბრძანება:
sudo ditto /usr/include/tidy /Applications/xampp/xamppfiles/include
ეს პროცედურა მნიშნველოვანია რადგან PHP – სთან არსებული კონფლიქტის გამო საჭიროა tidy – ს ფაილებში ცვლილების შეტანა, ხოლო XAMPP – ში tidy არ დევს.
-
ახლად დაკოპირებული კატალოგიდან გახსენით ფაილი:
/Applications/xampp/xamppfiles/include/tidy/platform.h
და 526 – ე ხაზიდან 531 ხაზის ჩათვლით არსებული კოდი:
#if !defined(HPUX_OS) && !defined(CYGWIN_OS) && !defined(MAC_OS_X) && !defined(BE_OS) && !defined(SOLARIS_OS) && !defined(BSD_BASED_OS) && !defined(OSF_OS) && !defined(IRIX_OS) && !defined(AIX_OS) && !defined(LINUX_OS) typedef unsigned int uint; #endif #if defined(HPUX_OS) || defined(CYGWIN_OS) || defined(MAC_OS) || defined(BSD_BASED_OS) || defined(_WIN32) typedef unsigned long ulong; #endif
ჩაანაცვლეთ შემდეგი კოდით რათა თავიდან ავირიდოთ PHP – სთან არათავსებადობის პრობლემა:
#if !defined(HPUX_OS) && !defined(CYGWIN_OS) && !defined(MAC_OS_X) && !defined(BE_OS) && !defined(SOLARIS_OS) && !defined(BSD_BASED_OS) && !defined(OSF_OS) && !defined(IRIX_OS) && !defined(AIX_OS) && !defined(LINUX_OS) #undef uint; /* avoid conflict with PHP */ typedef unsigned int uint; #endif #if defined(HPUX_OS) || defined(CYGWIN_OS) || defined(MAC_OS) || defined(BSD_BASED_OS) || defined(_WIN32) #undef ulong; /* avoid conflict with PHP */ typedef unsigned long ulong; #endif
-
შენახულ PHP – ს კონფიგურაციას დაამატეთ შემდეგი ორი პარამეტრი.
იმ შემთხვევაში iconv არ არის თქვენს კონფიგურაციაში, საჭიროა მისი ცხადად მითითება, წინააღმდეგ შემთხვევაში კომპილაცია წარუმატებელი იქნება:
--with-iconv=/Applications/xampp/xamppfiles
ასევე მიუთითეთ tidy – ს გასააქტიურებლად საჭირო პარამეტრი:
--with-tidy=/Applications/xampp/xamppfiles
-
კონფიგურაციის პარამეტრების მომზადების შემდეგ ტერმინალიდან გადადით PHP – ს დისტრიბუტივის კატალოგში:
cd /Users/iosebdzmanashvili/Documents/PHP/php-5.2.6
და ტერმინალში შეასრულეთ შემდეგი ბრძანება:
./configure --prefix=/Applications/xampp/xamppfiles --program-suffix=-5.2.6 --libdir=/Applications/xampp/xamppfiles/lib/php/php5 --includedir=/Applications/xampp/xamppfiles/include/php/php5 --with-apxs2=/Applications/xampp/xamppfiles/bin/apxs --with-config-file-path=/Applications/xampp/etc --with-mysql=/Applications/xampp/xamppfiles --disable-debug --enable-bcmath --enable-calendar --enable-ctype --enable-dbase --enable-discard-path --enable-exif --enable-filepro --enable-force-cgi-redirect --enable-ftp --enable-gd-imgstrttf --enable-gd-native-ttf --with-ttf --enable-magic-quotes --enable-memory-limit --enable-safe-mode --enable-shmop --enable-sigchild --enable-sysvsem --enable-sysvshm --enable-track-vars --enable-trans-sid --enable-wddx --enable-yp --with-ftp --with-ncurses=/Applications/xampp/xamppfiles --with-gdbm=/Applications/xampp/xamppfiles --with-jpeg-dir=/Applications/xampp/xamppfiles --with-png-dir=/Applications/xampp/xamppfiles --with-freetype-dir=/Applications/xampp/xamppfiles --without-xpm --with-zlib=yes --with-zlib-dir=/Applications/xampp/xamppfiles --with-openssl=/Applications/xampp/xamppfiles --with-expat-dir=/Applications/xampp/xamppfiles --enable-xslt=/Applications/xampp/xamppfiles --with-xsl=/Applications/xampp/xamppfiles --with-dom=/Applications/xampp/xamppfiles --with-ldap=/Applications/xampp/xamppfiles --with-gd=/Applications/xampp/xamppfiles --with-mysql-sock=/Applications/xampp/xamppfiles/var/mysql/mysql.sock --with-mcrypt=/Applications/xampp/xamppfiles --with-mhash=/Applications/xampp/xamppfiles --enable-sockets --with-curl=/Applications/xampp/xamppfiles --enable-mbregex --enable-zend-multibyte --with-zip=/Applications/xampp/xamppfiles --enable-exif --with-sqlite --with-libxml-dir=/Applications/xampp/xamppfiles --enable-soap --enable-pcntl --enable-dbx --with-mysqli=/Applications/xampp/xamppfiles/bin/mysql_config --with-bz2=/Applications/xampp/xamppfiles --with-ming=shared,/Applications/xampp/xamppfiles --with-pear=/Applications/xampp/xamppfiles/lib/php/pear --with-mssql=/Applications/xampp/xamppfiles --with-imap-dir=/Applications/xampp/xamppfiles --with-imap=/Applications/xampp/xamppfiles --enable-mbstring=all,/usr --with-gettext=/Applications/xampp/xamppfiles --with-pdo-mysql=/Applications/xampp/xamppfiles --with-iconv=/Applications/xampp/xamppfiles --with-tidy=/Applications/xampp/xamppfiles
-
./configure ოპერაციის დასრულების შემდეგ ტერმინალში აკრიფეთ შემდეგი სამი ბრძანება:
პროცესის დასრულების შემდეგ:
გილოცავთ! ინსტალაცია დასრულებულია
გადატვირთეთ Apache და განაგრძეთ მუშაობა
P.S.
ფაილების მისამართებში გამოყენებული მომხმარებელის სახელი “iosebdzmanashvili” უნდა შეცვალოთ თქვენი მომხმარებლის სახელით
ვაა გილოცავ, როგორც ვხედავ გაგიკეთებია რაც გსურდა
. ახლა კი რახან ყველაფერი კარგადაა (იმედია) ცოტა “რომანწიკაც” არ გაწყენდა
XAMPP ის ბოლო ვერსია ეს ვერსია რიტი გავხსნა? არ იხსნება
@მასტერ
ამ პოსტში XAMPP – ის საკმაოდ ძველ ვერსიაზე წერია… თან Mac OS X – ისთვის. რომელ ოპერაციულზე უშვებ და რომელ ვერსიას?
რომელი ვერსია ჯობია ვინდოუსისთვის? და თუ შეგიძლიათ მასწავლოთ როგორ მივამაგრო დომენი ხამპპ სერვერს
@მასტერ
ვინდოუსის ვერსიას არ ვიყენებ სამწუხაროდ ვერაფერს გეტყვი…
დომენის მიმაგრებას რას ეძახი? ვირტუალური ჰოსტი რომ გააკეთო? არ მგონია ასე მარტივად აგიხსნას აქ ვინმემ… ისევ დოკუმენტაციას ჯობია ჩაუჯდე.