Oil is a primary source of energy worldwide. However, the use of oil produces large amounts of pollutants, which are detrimental to the environment. The presence of petroleum hydrocarbons in soil is a critical marker of environmental pollution and safety. Rapid on-site detection technology has been broadly used in emergency tracking, offering critical information support for effective reactions to environmental emergencies. Thus, it is expected to play an increasingly critical role in environmental remediation efforts. The current approach for petroleum hydrocarbon detection in soil mainly involves Soxhlet extraction with a combination of solvents, including acetone and n-hexane. The samples are then analyzed after rotary evaporation, dehydration with anhydrous sodium sulfate, and purification using a magnesium silica-type adsorbent. Unfortunately, this approach requires sample analysis to be performed in the laboratory, which is tedious and time consuming, and consumes large amounts of solvents. Moreover, the rotary evaporator is not portable. Therefore, this method is not appropriate for the rapid on-site detection of petroleum hydrocarbons. In this study, a rapid on-site detection method based on silica-gel dehydration and cyclohexane extraction was developed for the extraction and pretreatment of petroleum hydrocarbons (C10-C40) in soil. First, an appropriate amount of silica gel was added to the soil, and the mixture was completely ground to eliminate moisture. Next, petroleum hydrocarbons were extracted with 40 mL of cyclohexane, and the extract was cleaned by Florisil solid-phase extraction (SPE) column elution. Finally, the samples were analyzed by gas chromatography (GC) to evaluate the above method. The silica gel exhibited optimal adsorption properties compared with anhydrous sodium sulfate, calcium oxide, and molecular sieves, with recovery of 87.5%. The effects of different soil water content (5%, 10%, and 20%) and silica gel (1, 3, 5, and 10 times the moisture content) dosage on the extraction of petroleum hydrocarbons were investigated. The recoveries of petroleum hydrocarbons increased from 74.0% to 103.8% after 15 min of invasive extraction (relative standard deviation, RSD, <10.1%) when silica gel amounting to 10 times the moisture content was used. Five types of silica gels with different properties were purchased from four manufacturers, and the effects of these silica gels on the dehydration and extraction efficiency of petroleum hydrocarbons in soil were assessed. The results showed that amorphous silica gel led to low recoveries (<60%), spherical silica gel achieved extraction efficiencies of approximately 70%-90%, and alkaline silica gel produced recoveries with poor precision. Therefore, neutral spherical silica gel was used for further experiments. The fingerprints of petroleum hydrocarbons with different carbon numbers are an important reference for identifying pollution sources. Thus, ensuring good recoveries throughout the entire carbon range is necessary to ensure the accuracy of the fingerprint analysis results. The proposed method showed good recoveries for petroleum hydrocarbons of all carbon numbers (75%-101%). The findings above indicate that the developed method could be an efficient means to extract petroleum hydrocarbons from soil for both total quantity and fingerprint analyses. Compared with standard methods, the proposed method requires lower solvent dosages and features simpler processing steps. Another advantage of this method is that it does not require the use of highly toxic halogenated solvents; thus, it does not contribute to environmental pollution. It can be applied to the laboratory analysis of soil petroleum hydrocarbons and coupled with other rapid on-site detection techniques for soil petroleum hydrocarbons, such as infrared spectroscopy and portable GC. However, because it does not include a concentration process, the developed method exhibits relatively low sensitivity. In the future, we plan to develop a simple and flexible on-site sample-concentration system to further improve various indicators of this method.