LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-10-2010, 11:06 PM   #1
canad1an
LQ Newbie
 
Registered: Oct 2010
Posts: 2

Rep: Reputation: 0
Ways to start a PHP script


I just recently installed Fedora Server on my computer and I am planning on hosting my website on this server instead of paying for hosting..

All of my files for my website are currently using php but for some reason when I moved them here to "test" them before launching the final switch, the PHP does not work..

I have further investigated this issue to learn that my php files were written using:

<? and ?> to start the scripts

Apparently I have to write <?php and php?> to make these scripts work now.

Is there a way I can edit a system file to allow me to use both instead of having to change all my files?

-Matt
 
Old 10-11-2010, 12:05 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Hi,

You can use:
Code:
short_open_tag = On
in php.ini
 
Old 10-11-2010, 12:21 AM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Not necessarily a good idea; you're better off changing your code
to use the "proper" tags.

http://stackoverflow.com/questions/2...eptable-to-use



Cheers,
Tink
 
Old 10-11-2010, 08:28 AM   #4
canad1an
LQ Newbie
 
Registered: Oct 2010
Posts: 2

Original Poster
Rep: Reputation: 0
Thank you all very much! I have read the arguments on the other page and have decided to keep the short tags on.
It seemed to me that there was little ground to turn them off, especially since I would be hosting my own server.

Thank you again!!!

-Matt
 
Old 10-11-2010, 01:18 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Shame, considering how quick and easy the fix is...

Code:
find -iname \*.php -exec sed -i.bak -r 's/<\?([[:space:]]*.*)/<?php\1/g' {} \;
?> is a valid tag w/o short_tags, so the opening
tag is all that needs fixing.


Cheers,
Tink
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: 15 Ways Nokia’s N900 Is Better Than Apple’s iPhone (and 5 ways it’s not) LXer Syndicated Linux News 0 11-14-2009 08:20 AM
Ways to load or run an excutable at start up, advantages and drawbacks, etc. lumix Linux - Newbie 2 02-14-2008 01:16 PM
LXer: Title: PHP/MySQL Classifieds Script AddAsset1.php Script Insertion LXer Syndicated Linux News 0 07-02-2006 06:21 PM
PHP script to launch at start Black187 Linux - Software 1 04-25-2006 05:13 AM
howto start vpnclient with php script and sudo ? cccc Programming 1 01-12-2004 11:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration