Find the answer to your Linux question:
Results 1 to 3 of 3
Hello, I'm trying to create an utility tool with php but when I try to access the files(from the browser) I get the Save As... dialog. I've checked the configuration ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2012
    Posts
    2

    PHP files not beeing parsed


    Hello,
    I'm trying to create an utility tool with php but when I try to access the files(from the browser) I get the Save As... dialog.

    I've checked the configuration files and everything seems ok; the httpd -M shows that the php5 module(shared) is loaded, httpd -t says that the syntax is ok.(Also Plesk is working)

    I'm running a CentOS, httpd(Apache 2.2.3) as a service and the config files are:

    conf.d/php.conf
    Code:
    <IfModule prefork.c>
       LoadModule php5_module modules/libphp5.so
    </IfModule>
    <IfModule worker.c>
       LoadModule php5_module modules/libphp5-zts.so
    </IfModule>
    AddHandler php5-script .php
    AddType text/html .php
    DirectoryIndex index.php
    httpd.conf
    Code:
       .....
       Include conf.d/*.conf
       .....
      <VirtualHost XXX.XXX.XXX.XXX:80>
        ServerName //not allowed to post URLS//:80
        ServerAlias  //not allowed to post URLS//
        UseCanonicalName Off
        ServerAdmin "not allowed to post URLS"
        DocumentRoot /var/www/vhosts/xxxxx.com/httpdoc
        ErrorLog /var/www/vhosts/xxxxx.com/errors/mainlog
      </VirtualHost>
       .....
      AddType application/x-httpd-php .php
      AddType application/x-httpd-php-source .phps
    I also found a php-cgi.conf in the conf.d directory

    Code:
    scriptAlias /phppath/ "/usr/bin/"
    Action php-script /phppath/php-cgi
    I have looked in the /usr/bin directory and there are php and php-cgi files present.

    I also found two php.ini files:
    /usr/local/psa/admin/conf/php.ini
    /etc/php.ini


    I've looked for the error logs but there's nothing in there to suggest that there is a problem.

    What I tried to run is the following:
    gogu.php (Save as dialog appears)
    Code:
       <html>
        <head><title>test</test></head>
        <body>
           test<br>
          <?php
             echo "working";
          ?>
        </body>
      </html>
    gogu1.php(Save as dialog appears)
    [CODE]
    <?php phpinfo(); ?>
    [CODE]

    Any ideas?

    Thanks.

  2. #2
    Linux Newbie arespi's Avatar
    Join Date
    May 2011
    Location
    Monterrey , Mexico
    Posts
    152
    Did you set in your php script the execute permission? (chmod g+x php_file_name)

  3. #3
    Just Joined!
    Join Date
    Feb 2012
    Posts
    2
    Hello,
    Yes I have set all the rights but still no luck.
    I've installed the php53 and now I'm not getting the Save as dialog but the files are not being processed. Instead of getting the result of the phpinfo() I see in the browser
    Code:
    <?php phpinfo ?>
    Thanks for your reply.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •