Mac Os X XAMPP: Tidy – ს ინსტალაცია PHP-5.2.6 – სთვის

ამ პოსტში მინდა მოგითხროთ პატარა ისტორია Mac OS X – ზე PHP – ს რეკომპილაციით მიღებულ “სიამოვნებასა” და უსაზღვრო “კომფორტზე” რომელიც ბოლო ორი დღის განმავლობაში მივიღე.

მაშ ასე, თუ თქვენ იყენებთ XAMPP – ს და გესაჭიროებათ PHP – სთვის tidy გაფართოვების დამატება რომელიც სამწუხაროთ XAMPP – ს არ მოყვება, გაგახარებთ და გეტყვით რომ საკმაოდ სერიოზული პრობლემის წინაშე დგახართ :D

რა არის საჭირო ამ მიზნის მისაღწევად? მივყვეთ ნაბიჯ ნაბიჯ:

  1. შეინახეთ ყველა არსებული პროექტი უსაფრთხო ადგილას;
  2. გაანადგუროთ ყველა არსებული PHP ინსტალაცია, ამისათვის ტერმინალში აკრიფეთ შემდეგი ბრძანებები:

    sudo rm -rf /Applications/xampp
    sudo rm -rf /usr/include/php
    sudo rm -rf /usr/lib/php
    
  3. გადმოწეროთ XAMPP ის ბოლო ვერსია და დააინსტალირეთ;
  4. გადმოწერეთ XAMPP – ის დეველოპერ პაკეტი ნებისმიერ ადგილას, შედით შესაბამის კატალოგში და დააინსტალირეთ შემდეგი ბრძანებით:

    sudo tar xvfpz xampp-macosx-0.7.4-dev.tar.gz -C /Applications/xampp
    
  5. გადმოწერეთ PHP 5.2.6 – ის დისტრიბუტივი და გახსენით არქივი ნებისმიერ მისამართზე, მაგ:

    /Users/iosebdzmanashvili/Documents/PHP/php-5.2.6
    
  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
    

ახლა იწყება ყველაზე საინტერესო და არასასიამოვნო პროცესი რომლის გარკვევაზეც არცთუ ცოტა დრო დამეხარჯა:

  1. გახსენით ფაილი:

    /Users/iosebdzmanashvili/Documents/PHP/php-5.2.6/ext/tidy/tidy.c
    

    მოძებნეთ გახსნილ ფაილში #include “tidy.h” და გადაიტანეთ იგი ფაილის დასაწყისში.

  2. tidy – ს xampp – ში დასაკოპირებლად ტერმინალში აკრიფეთ შემდეგი ბრძანება:

    sudo ditto /usr/include/tidy /Applications/xampp/xamppfiles/include
    

    ეს პროცედურა მნიშნველოვანია რადგან PHP – სთან არსებული კონფლიქტის გამო საჭიროა tidy – ს ფაილებში ცვლილების შეტანა, ხოლო XAMPP – ში tidy არ დევს.

  3. ახლად დაკოპირებული კატალოგიდან გახსენით ფაილი:

    /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
    
  4. შენახულ PHP – ს კონფიგურაციას დაამატეთ შემდეგი ორი პარამეტრი.

    იმ შემთხვევაში iconv არ არის თქვენს კონფიგურაციაში, საჭიროა მისი ცხადად მითითება, წინააღმდეგ შემთხვევაში კომპილაცია წარუმატებელი იქნება:

    --with-iconv=/Applications/xampp/xamppfiles
    

    ასევე მიუთითეთ tidy – ს გასააქტიურებლად საჭირო პარამეტრი:

    --with-tidy=/Applications/xampp/xamppfiles
    
  5. კონფიგურაციის პარამეტრების მომზადების შემდეგ ტერმინალიდან გადადით 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
    
  6. ./configure ოპერაციის დასრულების შემდეგ ტერმინალში აკრიფეთ შემდეგი სამი ბრძანება:

    პროცესის დასრულების შემდეგ:

    make clean //გაუგებრობების თავიდან ასაცილებლად
    make //აქ შეგიძლიათ ყავა მოიმზადოთ, სიგარეტი მოწიოთ და კურიერს უყუროთ :D  :D
    sudo make install
    

გილოცავთ! ინსტალაცია დასრულებულია :D გადატვირთეთ Apache და განაგრძეთ მუშაობა :)

P.S.
ფაილების მისამართებში გამოყენებული მომხმარებელის სახელი “iosebdzmanashvili” უნდა შეცვალოთ თქვენი მომხმარებლის სახელით :)

ტეგები: , ,

5 Responses to “Mac Os X XAMPP: Tidy – ს ინსტალაცია PHP-5.2.6 – სთვის”

  1. ვაა გილოცავ, როგორც ვხედავ გაგიკეთებია რაც გსურდა ;) . ახლა კი რახან ყველაფერი კარგადაა (იმედია) ცოტა “რომანწიკაც” არ გაწყენდა :D

  2. მასტერ says:

    XAMPP ის ბოლო ვერსია ეს ვერსია რიტი გავხსნა? არ იხსნება

  3. @მასტერ

    ამ პოსტში XAMPP – ის საკმაოდ ძველ ვერსიაზე წერია… თან Mac OS X – ისთვის. რომელ ოპერაციულზე უშვებ და რომელ ვერსიას?

  4. რომელი ვერსია ჯობია ვინდოუსისთვის? და თუ შეგიძლიათ მასწავლოთ როგორ მივამაგრო დომენი ხამპპ სერვერს

  5. @მასტერ

    ვინდოუსის ვერსიას არ ვიყენებ სამწუხაროდ ვერაფერს გეტყვი…

    დომენის მიმაგრებას რას ეძახი? ვირტუალური ჰოსტი რომ გააკეთო? არ მგონია ასე მარტივად აგიხსნას აქ ვინმემ… ისევ დოკუმენტაციას ჯობია ჩაუჯდე.

დატოვე კომენტარი:

ქართული კლავიატურა, ჩართვა/გამორთვა კლავიშით "~"